I'm trying to devices an AppleScript that will automatically press the right arrow key for 1 second, then the left arrow key for 1 second and repeat this in an endless loop until I interrupt it.

Here is what I've come up with so far, but it's not quite working:

```
tell application "VisualBoyAdvance"
    repeat 100 times
        tell application "VisualBoyAdvance" to keystroke "124"
        delay 1
    end repeat     
end tell 

```