I have a regular Applescript application bundle that executes an applescript file when it's run. I'm trying to run a shell file that is located at "/Contents/Resources/Data/df.sh", however with the code I'm using, it keeps giving me "resource not found" errors.
set bashFile to path to resource "df.sh"
do shell script "bash " & bashFile
I'm really new to Applescript, so there's the chance I'm doing something obvious wrong.
Best Answer
There are a few reasons it didn't work.
path to resource
basically takes the bundle path and finds files in there, so you need to actually put the subdirectory, in this case "Data."~/Desktop/test folder
shows up as 2 arguments tobash
. To fix this just put quotes around it, as you would any other time, withquoted form of
.Here's the fixed script: