Need Some Help? Have a Tip to Share?

Email me at MacTipper@gmail.com, or, leave a comment!

Subscribe To Our FREE RSS Feed!

Don't miss out on any posts from the Concise MacTipper Blog.

Thursday, May 21, 2009

Add AppleScript Support to Applications

It is rather simple to add AppleScript support to an application, here's how:

Step 1: Open the application in Finder.

Step 2: Right click on the application and select "Show Package Contents".

Step 3: In the window that opens, open the "Info.plist" file inside the "Contents" folder using TextEdit.

Step 4: Search the document (Cmd-F) for "NSAppleScriptEnabled". If you find it, look under it for "<false/>" and change the "false" to "true". Save the file (Cmd-S) and skip to step 6.

Step 5: If you don't find the NSAppleScriptEnabled item, you'll need to add it. Scroll to the bottom of the document and look for "</dict>". Add the following two lines of text right above that:

<key>NSAppleScriptEnabled</key>
<true/>


You'll probably want to add tabs to the beginning of the lines to make them line up with the rest of the items. Hit Cmd-S to save.

Step 6: Now, all you need to do is let your computer know that you made the change. To do this, open up Terminal and run this one-line Terminal command:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


You should now be able to perform basic AppleScript functions in the previously unsupported application.

0 comments:

Post a Comment