how do you run an applescript from an applescript.
something that would have the same effect as
set answer to do shell script "osascript /test.scpt"
return answer
but would allow me to specify a path like
set MyPath to "Mac OS X:Scripts Folder:My Script.scpt"
Camelot
#2
If you’re using ‘do shell script’ to run the script you need to use Unix-style (slash-delimited) paths, not Mac-style (colon-delimited) ones:
set scriptPath to "/Users/me/my.scpt"
do shell script "osascript " & scriptPath
However, you don’t need to incur the overhead of ‘do shell script’ when you can run the script directly:
set scriptPath to "Macintosh HD:Users:me:my.scpt"
run script file scriptPath
Note in the latter case, ‘run script’ requires a Mac-style file path.
In both cases you can build a dynamic path via something like:
set scriptPath to (path to home folder as string) & "my.script"
which will work out the path to the current user’s home directory, so you don’t need to know the full path (or even user name) in advance.