set strokecount to 10
set namecount to 0
tell application "TextEdit" to activate
tell application "System Events"
keystroke "a" using command down
delay 0.2
keystroke "c" using command down
delay 0.2
end tell
tell application "Safari" to activate
delay 0.2
tell application "System Events"
(*setup*)
repeat 10 times
beep
tell application "Safari" to activate
repeat strokecount times
keystroke tab
delay 0.1
end repeat
tell application "Safari" to activate
log namecount
repeat (namecount * 2 + 1) times
keystroke tab using option down
delay 0.1
end repeat
delay 1
tell application "Safari" to activate
keystroke return
delay 5
keystroke "v" using command down
delay 1
keystroke tab
delay 1
key code 125 (*down key*)
delay 2
do shell script "/usr/local/bin/cliclick c:483,760"
delay 6
key code 53
delay 3
set namecount to namecount + 1
end repeat
display dialog "Done" buttons {"OK"} default button 1
end tell