2

私はアップルスクリプトが初めてで、それを試しています。これに似たコードを使用して、textedit にテキストを入力しています。

tell application "textedit"
    activate
    set n to a random number between 1 and 100
    repeat 100 times
        tell application "System Events"
            delay 4
            keystroke n
            delay 3
        end tell
     end repeat
end tell

これは、textedit がフロント ウィンドウにある限り正常に機能しますが、Chrome で何かを行うと、Chrome でアクティブなテキスト フィールドにテキストが入力されます。textedit がバックグラウンドにある場合でも、テキストを入力するにはどうすればよいですか?

前もって感謝します :)

4

1 に答える 1