Automator/Applescript + Safari

Soldato
Joined
18 Oct 2002
Posts
16,397
Location
Manchester
Hi,

Just wondering if someone with a bit more grey matter than me can help me figure out how to accomplish something with Automator/Applescript?

So the basic gist is that I have a webpage with a list of text boxes one after another stacked vertically. You can navigate by tabbing down to the next one.

Each time you tab the information inside is highlighted, I want to delete it by pressing backspace.

I want to do this a lot, the number of text boxes varies day to day.

So, at the moment I click onto safari, load the page, click in the first box, press delete, then tab/delete my way down about 50 - 70 boxes. It is inefficient and annoying to do this every morning.

I have tried the "watch me do" feature of automator with no success and applescript goes over my head, I can't even figure out how to make it understand the tab key press.

an example I might have would be

Code:
tell application "Safari"
	activate
end tell

tell application "System Events" to tell process "Safari"
	set frontmost to true
	
	repeat 30 times
		keystroke tab
                delay 0.2
		keystroke (ASCII character 8)
	end repeat
	
end tell

I am hoping that with the first text box selected I can run this script and have it tab/delete the information from each box.

Now I think, that as soon as I click away from Safari the text box deselects, so I'll either have to find a way to have the cursor select the first text box, or set the script to a hotkey.

If anyone else has any ideas I would be most appreciative.
 
Back
Top Bottom