Applescript - Unable to find resource when inside application
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."
Applescript uses its own (stupid) file path syntax, so you need the POSIX version.
It breaks on spaces because appending the POSIX path ~/Desktop/test folder shows up as 2 arguments to bash. To fix this just put quotes around it, as you would any other time, with quoted form of.


Here's the fixed script:


set bashFile to path to resource "Data/df.sh"
do shell script "bash " & quoted form of (POSIX path of bashFile)