I want to write a script in AppleScript that will output all numbers from 0000
to 9999
in turn to an application (here it is System Preferences) using the keystroke
command. I have this so far that will do one number:
tell application "System Preferences" to activate
delay 0.5
tell application "System Events"
keystroke (1234)
end tell
But I would have to manually make 9998 more of these, which is obviously undoable.
I also have text file that has all of the numbers from 0000 to 9999 in a format like:
0000 0001 0002 0003 0004 0005
etc, and also a text file formatted like
0001
0002
0003
0004
0005
etc.
How could I import each of these numbers in turn to the keystroke
command in the script I wrote above, so that it would go through all of those numbers in the same script? Maybe in a repeating script?
I would also want to output a terminal command after each keystroke command, but I think I could manage that.
Any help would be appreciated!