Mac OS X 10.10 (Yosemite) で applescript を使用しています。キーストローク アクションが 10.9 よりも大幅に遅くなる傾向があることに気付きました。
以下は私のAppleScriptで、ターミナルに「cd my current path in Finder
」と入力して押すように指示しますreturn
:
tell application "Finder"
try
set currentFolder to (folder of the front window)
set currentPath to (POSIX path of (target of the front window as alias))
on error
set currentFolder to desktop
set currentPath to (POSIX path of (desktop as alias))
end try
end tell
tell application "Terminal"
activate
delay 0.5
tell application "System Events"
set cdtocurrentPath to "cd \"" & currentPath & "\"" as string
keystroke cdtocurrentPath
keystroke return
end tell
end tell
以前は、OS X 10.9 では、現在のパスを入力するためのキーストロークが非常に高速でした (長い文字列の場合は 1 秒未満)。ただし、10.10 では非常に遅くなる傾向があり (通常は 3 ~ 4 秒以上)、入力されている文字をはっきりと見ることができます。
さらに、 の他のアクションも 10.9 よりも遅いため、それらを適切に機能させるにSystem Events
は時間を増やす必要があります。delay
誰かがこれを説明できますか?または代替ソリューションを提供しますか?ありがとう!