AppleScript 代码
下面的代码在 AppleScript 中抛出语法错误(使用 Automator 时)。当代码在终端中运行时运行良好时,有什么建议可能导致它吗?
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可能需要在
activate
之后换行,即我还删除了一些多余的内容并在 OS X 10.6 上对此进行了测试。
I think you may need a line break after
activate
, i.e.I've also taken out some redundant stuff and tested this on OS X 10.6.