Firefox/System Events help required please...

Hi everyone,

I’ve been playing around with getting a list of urls from current windows open in Firefox.
I’ve found quite a few bits here and there and came up with the script below.
This script works and creates a list of urls from all the windows I’ve opened.


set windowList to {}

tell application "System Events" to set x to count of windows of process "Firefox"


tell application "Firefox" to activate
repeat with y from 0 to x
	tell application "System Events"
		keystroke "l" using {command down} -- Highlight the URL field.
		keystroke "c" using {command down}
		keystroke "w" using {command down}
	end tell
	
	delay 0.5
	
	set windowList to windowList & (the clipboard as text)
	
end repeat

There’s one slight niggle though, it closes each window as it goes along.
What I’ve been trying to do is activate each Firefox window in turn using System Events but as yet I’ve not had any luck.

Please can anyone point me in the right direction.

Thanks in advance.

Regards,

Nick

You might try replacing keystroke “w” using {command down} with keystroke “`” using command down. Hope this helps.

With Firefox 3.6.3, keystroke “]” using {command down, shift down} cycles round the tabs. Or keystroke “[” using {command down, shift down} if you want to go round the other way.