在我更新到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)
由于出现上述消息,我无法打开新的iterm窗口。即使看起来运行了太多进程,我也认为mac并没有运行太多进程。我检查了活动监视器,但找不到正常情况之间的任何区别。
我通过重新启动解决了这个问题,但想知道确切的问题以及如何检查。如果有人有任何想法,请与我分享。