1
tell application "BBEdit"
    activate
    tell window 1
        repeat 100 times
            repeat 5 times
                key code 124
            end repeat
            --select insertion point after character 5
            keystroke return
            --keystroke key code 36
        end repeat
    end tell
end tell

エラーを与える

error "BBEdit got an error: Can’t get keystroke \"
\" of window 1." number -1728 from keystroke "
" of window 1

私がやりたいのは、カーソルを 5 スペース動かしてエミュレートし、リターン キーを何度も何度も押すことだけです。

十分に単純に見えた...

4

1 に答える 1

2
delay 0.2
tell application "BBEdit"
    activate
    tell window 1
        repeat 100 times
            repeat 5 times
                tell application "System Events"
                    key code 124
                end tell
            end repeat
            tell application "System Events"
                keystroke return
            end tell
        end repeat
    end tell
end tell
于 2014-05-02T19:03:46.873 に答える