Is there an accepted way to obtain the folder path that contains a script?
Here's what I'm trying to do.
I want to launch script "a.scpt" using cron - at a certain time of day. Script "a.scpt" needs to run script "b.scpt". a.scpt and b.scpt will always reside in the same folder.
In order to do this currently, I have to hard-code the path of the script "b.scpt". Since both a.scpt and b.scpt reside in the same folder, I would rather obtain the path of the currently running script and use that to run the second script.
This works if the script is saved as an application: tell application "Finder" to set myFolder to (container of (path to me)) as string
but I want to be able to do the same thing from a script that's not saved as an application. Is this possible?
BTW, if you perform the above line from the script , you get the path to the Script Editor application, not the path of the script itself, which is what I need.
TIA,
Jim
|