Running a script with assets inside automator application So, I'm trying to write an automator application that runs a simple script.

python Contents/main.py


where Contents is the contents of the .app.

When the script is run it is run in ~ not in the working directory (wherever the file is placed on a system).

Is there a way to do this?

Note: I am not taking any input to the application, you just double click it.

Thanks,
Harry
You can get the path to Your executable from ps command. You need to know Your app name. Here's my code with EchoPath.app made in Automator:

DIR=`ps x | grep EchoPath | grep -v grep | cut -c 28- `


Sample output:

/Users/slozo/Desktop/EchoPath.app/Contents/MacOS/Application Stub


Application Stub is the default name of the executable created in Automator. Knowing this path You can get the path to Contents dir with dirname command.