Question

Where to find docs for the supported actions for tell application statement. Similar to

tell application "Finder" to close every window

How can I know that Finder is supported and also close every window is one of its actions?

Was it helpful?

Solution

I do not know of a list, per se, however AppleScript supported applications have a dictionary that you can view to see what's available to a given application, besides what available in the StandardAdditions.sdef file of Script Editor itself.

While in Script Editor press ⇧⌘L to bring up the Library, where you can double-click on Finder to review what's in its AppleScript dictionary.

Library

The Library is also accessible from the Window menu while in Script Editor.


Finder's AppleScript dictionary:

Finder's AppleScript dictionary


For example, looking at the Standard Suite, not selected in the image above, you'll see many verbs that are supported, one of them being close, so:

tell application "Finder" to close every window

Will indeed close any Finder windows that are open.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top