How do I find out the applescript commands available for a particular app?

I'm trying to find out if I can get iTunes to do something complex, but don't know what can be scripted.

Is there a way to find out what applescript commands an app will respond to?


Solution 1:

Yes, there is a simple way.

  1. Open the Script Editor app (formerly called AppleScript Editor)
  2. Go to File -> Open Dictionary
  3. Select the app you want to find out more about.

open applescript dictionary screenshot

When you open it, you can browse through the available AppleScript commands for that application and find what you want.

browsing dictionary screenshot

Solution 2:

Alternately, you can drag an application icon to the Script Editor icon to display its dictionary (if it has one). — via Apple’s AppleScript Language Guide