Where to find the a list of all application name available for tell application apple script?

1.2k Views Asked by At

For example in the tutorial here tell application "Finder" Finder is an app in my system. Terminal as well. However, if I replace Terminal with iTerm which is also an App named like that in my applications list, it wouldn't work. Even it is shown in some of the answer from SO like following

#!/bin/bash
osascript -e '
  tell app "iTerm"
    activate
    tell the first terminal
      launch session "Default Session"
      tell the last session
        set name to "New Session"
        write text "cd /usr/bin; ls"
      end tell
    end tell
  end tell'

it will return error of 52:60: syntax error: Expected class name but found identifier. (-2741)

Or something like

#!/bin/bash
osascript -e '
   tell application "Terminal"
   do script "date"
   activate
   end tell'

It works, but when I replace Terminal to iTerm it returns error of 35:41: syntax error: Expected end of line but found “script”. (-2741)

So suspect I am using the wrong app name even it appears to be iTerm is the actual app name, but it seems not, as it caused error above. If I can have a list of the actual app names I can use, it may help me to tackle it *NOTE: I do have iTerm installed, and that's why I want to refer to it...

0

There are 0 best solutions below