I am attempting to create an automator
app that executes a bash script which in turn uses some resource files (e.g. it deploys a docker-compose.yml file that I created).
I intend to share this app with my colleagues but I am having problems accessing the resource files. Regardless where the app is located if its script does this:
MYPATH=$(pwd) && osascript -e 'display alert "'"$MYPATH"'"'
home ~
gets displayed everytime. This is a problem because I have no way of knowing in which directory my colleagues are going to place the app and its script needs to know where the resource files are located.
Does anyone suggest a good approach to solve this? E.g. a bash command that returns the app location would be nice. I am not interested in any approach that requires instructing someone to place the app in a specific directory.
I solved it using path to me
of the Run AppleScript
option:
Its return value is passed as argument $1
to the next step.