在我更新到Mojave后,我再也无法使用我之前使用过的自动机服务了.

你看到我的代码有什么问题,或者这是最新macOS的问题?
脚本
on run {input, parameters}
set pathList to {}
repeat with itemNum from 1 to count of input
tell application "System Events"
copy POSIX path of (container of (item itemNum of input)) to end of pathList
end tell
end repeat
return pathList
end run
Run Code Online (Sandbox Code Playgroud)
我有一个发送电子邮件的简单AppleScript.如何在Swift应用程序中调用它?
(我无法通过谷歌找到答案.)