Name

path to

Synopsis

application and script file location

application and script file location

Locates an application by name, including the current application (the host application). Launches the application if it uses Cocoa scripting (I regard this as a bug). The special phrase path to me is supposed to give the alias of the current compiled script file, but in the past this has been unreliable; it is somewhat better in Tiger, though it can still go wrong depending on the script runner environment and the script file format (script bundles are problematic), and it doesn't work in Script Editor (works fine in Script Debugger).

Example

path to application "Finder"
-- alias "feathers:System:Library:CoreServices:Finder.app:"

Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.