18

I am looking to tell application "xyz", but by specifying a full path to the application. This is because there may be various versions of the app on the system in different places, but with the same name. If this possible?

Mathieu Tozer
  • 278
  • 2
  • 8

2 Answers2

19

Have you tried it? It works with either a posix style path or mac style path, so what's the issue? It couldn't be easier.

set posixCalculatorPath to "/Applications/Calculator.app"
set macCalculatorPath to (path to applications folder as text) & "Calculator.app"

tell application posixCalculatorPath to activate

delay 2

tell application "Calculator" to quit

delay 2

tell application macCalculatorPath to activate

One thing that you might not know how to do is to find the path to the application you want to target. I have created a tool found here which, if you feed it the path to a file then it will return the paths to all of the applications that could open that file. So that result would tell you if there is multiple applications with the same name and then you could choose which one to use.

regulus6633
  • 18,848
  • 5
  • 41
  • 49
7
launch application ":Applications:TextEdit.app"

tell application ":Applications:TextEdit.app" to launch
1.61803
  • 413
  • 8
  • 15