4

automator で初めて Apple スクリプトを使用しています。以前に起動したアプリケーション内でキーボード ショートカットを実行するスクリプトが必要です。

on run
activate application "MacCaption"
tell application "MacCaption"
    keystroke "x" using command down

end tell

構文エラーが発生すると予想される行末ですが、使用中の単語に識別子が見つかりました。

4

2 に答える 2

3

あなたの問題は、keystrokeシステム イベントを通過する必要があることです。また:

tell app "System Events"
    keystroke "x" using command down
end tell

また

tell app "System Events"
    tell process "MacCaption"
        keystroke "x" using command down
    end tell
end tell

実際の違いはありませんが、システム イベントが必要です。

于 2013-01-11T18:52:09.740 に答える
1

試す:

tell application "System Events" to keystroke "x" using command down
于 2013-01-09T22:48:16.480 に答える