Reputation: 49
The below code is throwing a syntax error in AppleScript (when using Automator). Any suggestions what may be causing it as the code runs fine when running in Terminal?
on run {input, parameters}
tell application "Terminal"
activate (do script with command "perl -mURI -lne 'print ((URI->new(/([\S]+) \z/msx)->path_segments)[-1])' < testfile.txt > testfile1.txt")
end tell
return input
end run
Upvotes: 1
Views: 376
Reputation: 213200
I think you may need a line break after activate
, i.e.
on run
tell application "Terminal"
activate
do script "perl -mURI -lne 'print ((URI->new(/([\\S]+) \\z/msx)->path_segments)[-1])' < testfile.txt > testfile1.txt"
end tell
end run
I've also taken out some redundant stuff and tested this on OS X 10.6.
Upvotes: 2