Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ABOUT --
- -- This runs & emulates key strokes entering search terms. Whilst it's running you can't really use the computer it's running on I'm afraid.
- -- It was written and tested on OS X 10.8.4 Mountain Lion & with FF 22.0
- -- There are no guarantees using this. Run at your own risk.
- -- SETUP --
- -- To use this you must have FULL KEYBOARD ACCESS enabled in system preferences!
- -- System Prefs > Keyboard > Keyboard Shortcuts
- -- Put dot next to "All controls" at the bottom of the window
- -- How many presses of the tab key does it take to get from Firefox's address bar to the QANTAS Frequent Flyer search box?
- set tabPresses to 2
- -- Get number of words in Unix dict file
- set numberOfWords to (do shell script "wc -l /usr/share/dict/words | sed 's/[^0-9]//g'") as number
- -- Loop through 150 times (1 months worth)
- repeat 150 times
- -- Get a random word
- set randomNumber to random number from 1 to numberOfWords
- set randomWord to do shell script "sed -n '" & randomNumber & "p' /usr/share/dict/words"
- -- Open Firefox
- tell application "Firefox" to activate
- tell application "System Events"
- keystroke "l" using {command down} -- Select the main URL bar
- delay 1
- -- Tab to the FF search box
- repeat tabPresses times
- keystroke tab
- end repeat
- -- Enter random word
- keystroke randomWord
- keystroke return
- -- Delay a random time (wait for point to be counted) and avoid it looking like a computer
- delay (random number from 10 to 40)
- end tell
- end repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement