How do I link/call an actual shell script saved within an Applescript app? What's the correct syntax in the Applescript below to make this app run by double clicking on it rather than how it runs now by just running the Applescript in the AS script editor?

The Shell script is located at:

ToggleHidden.app/Contents/Resources/Scripts/toggle.sh

And it is set to execute by all.   (I did chmod a+x toggle.sh)



Applescript

set bottomRoot to (path to me) as alias

 tell application "System Events"
 set myPath to (POSIX path of container of bottomRoot)

end tell

set scriptPath to quoted form of (myPath &amp; "/toggle.sh")

do shell script scriptPath




Shell script

#!/bin/sh

STATUS=`defaults read com.apple.finder AppleShowAllFiles

if [ $STATUS == TRUE ];

then

defaults write com.apple.finder AppleShowAllFiles FALSE

else

defaults write com.apple.finder AppleShowAllFiles TRUE

fi

killall Finder

sleep .5

open .
Try:

set myPath to POSIX path of ((path to me as text) &amp; "Contents:Resources:Scripts:toggle.sh")