I have an AppleScript that calls another script (a perl script in this case) which resides in the same folder as the AppleScript.
Now I'm trying to put the script into a variable like this:
tell application "Finder" set scriptPath to POSIX path of (container of (path to me) as text) set perlScript to (do shell script "find " & quoted form of scriptPath & " -name myscript.pl") end tell
But the result that I get from the find shell command has two slashes before the file name:
Anyone any idea what I'm doing wrong?
While I don't quite understand the double slash I managed to resolve the problem by not invoking the Finder at all and doing the following:
set scriptPath to POSIX path of (path to me) -- path to AppleScript set scriptFolder to do shell script "dirname " & quoted form of scriptPath -- path to folder with AppleScript set perlScript to (do shell script "find " & quoted form of scriptFolder & " -name myscript.pl") -- path to PerlScript
Don't know if that's the best way to do it but it works for me.