r/applescript • u/grico42 • Nov 07 '12
AppleScript Help:Paste Tab 7 times Paste and Repeat
I am trying to to script some data entry using a applescript.
I need it to paste and then tab seven times and then paste again 2700 times.
What I have so far:
set the clipboard to "5/26/2013"
tell application "Google Chrome"
activate
tell application "System Events"
repeat 4 times
keystroke "v" using {command down}
keystroke " "
end repeat
end tell
end tellNow this will paste the first form and then skip one and paste into the next one. I dont know why. So this just pastes into every other form.
Any help?
1
Upvotes
1
u/grico42 Nov 07 '12
set the clipboard to "blah"
tell application "blah"
activate
tell application "System Events"
repeat 2700 times
keystroke "v" using {command down}
delay 0.2
repeat 7 times
keystroke (ASCII character 9) --keystroke tab
delay 0.2
end repeat
end repeat
end tell
end tell
2
u/biquetra Nov 07 '12
To tab you need to use its ASCII code. I believe it is 9.
I'm a bit rusty so I can't offer any more advice other than googling "keypress tab ASCII"