Checking radio buttons or check boxes in Safari

I can’t figure out how to ‘check’ or ‘mark’ a radio button or a check box in Safari. I downloaded a scripting edition called Extra Suites which lets me move the mouse and click. But that’s a little bit unstable since the window has to be in the exact same spot of the screen everytime i run it. Can anybody help me with this?

This is my script as of now:

delay 20 -- delay while the page loads
tell application "Extra Suites"
	ES move mouse {415, 685} 
	delay 5
	ES click mouse 
	delay 1
	ES click mouse 
	delay 5
	ES move mouse {955, 685}
	ES click mouse
	delay 1
	ES click mouse 
	delay 5
	ES move mouse {600, 515}
	ES click mouse 
end tell
delay 20 -- delay while page loads
tell application "Extra Suites"
	ES move mouse {710, 505} 
	ES click mouse
	delay 1
	ES click mouse
	delay 5
	ES move mouse {955, 685}
	ES click mouse
	delay 5
	ES move mouse {600, 465}
	ES click mouse
end tell
delay 20 -- delay while page loads
tell application "Extra Suites"
	ES move mouse {955, 685} 
	ES click mouse 
	delay 5
	ES move mouse {560, 545}
	ES click mouse
end tell

Can somebody please help me? :?

If you download this one:
http://scriptbuilders.net/category.php?id=1745
You’ll find there “sfri Library”, which comes with handy documentation and examples, and will help you to do more efficiently and speedy.
If you find problems, post here the related web page and we’ll take a look.

Hi,

If you still can’t find the answer, then try this. Use the location of whatever you want to click releative to the position of the window. In your script, once you get the position of the thing you want to click on with relation to the window, you then add it to the upper left poition of the window. for instance suppose I know that the position of the thing is {110,38} in the window (on my safari this is the make text larger button). The script would look like this using System Events:

tell application “Safari”
activate
set {x, y} to bounds of front window
end tell
–delay 1
tell application “System Events”
tell process “Safari”
click at {110 + x, 38 + y}
end tell
end tell
–110,38

If you need help with getting the coordinates releative to the window it’s easy. Once you get the coordinates relative to the screen, just subtract the window position. A simple script can do this:

tell application “Safari”
activate
set {x, y} to bounds of front window
end tell
set {wx, wy} to {110 - x, 60 - y}

where {110,60} is the position of the item relative to the screen.

gl,

Thanks jj and kel. sfri Library is great for what I need to do. I appreciate the help :smiley: