# Get current path of Automator app

I am trying to create an Automator application which I will be distributing to other users on the network. The automator app will be accompanied by a ZIP file and a PKG installer file.

I need to run the PKG installer file the automator app. For this I'm trying to use the Run Shell Script using the following command:

open gdata.pkg


The problem I'm having is that Automator cannot find this file. I think it doesn't pick up the current path. I tried changing it to following ways:

Experiment #1:

cd \$@; open gdata.pkg


Experiment #2:

open ./gdata.pkg


Both didn't work for me. Automator keeps giving error that it couldn't run the script. How do I accomplish this here?

My next step after this would be to decompress the accompanied ZIP file onto a new folder on user's desktop.

Use a Run AppleScript action with the following to get the path:

POSIX path of (path to me)


When run in the workflow, this provides the path to Automator.app, but when run by launching the saved application, this provides the path to the application.

• Ok that was a good lead. I've managed to develop a code to make it happen: 'set pathToMe to POSIX path of (path to me as text)', and (set script1 to "dirname '" & pathToMe & "'"), and (set dirPath to do shell script script1), then finally (do shell script "open '" & dirPath & "/GData.pkg'"). I'm not sure if this is the best way to make this work. – Faraz Azhar Jan 17 '15 at 17:02

• The question already has an accepted answer and your link only answer provides the same thing (path to me) and therefore is needlessly redundant! – user3439894 Nov 14 '16 at 15:16