AppleScript Tidbits

November 11, 2006

AppleScript URL protocol support

Getting the home directory:

set theHomeDir to the POSIX path of home directory of (system info)

Getting and setting the clipboard:

set whatever to the clipboard

set the clipboard to "whatever"

Encoding URLs Personally, I think you’re best off just piping it through PHP:

do shell script "echo myurl | /usr/bin/php -r \"urlencode(fgets(STDIN));\""

Bu there’s also some info on Apple’s website.

How does ScriptEditor know which app is scriptable? By looking for the NSAppleScriptEnabled key in an application bundle’s Info.plist