Help scripting Photoshop CS3 to turn off "Snap to:

Hi, small bit of frustration with Photoshop CS3 on the Mac. Basically, every time you open a document, Photoshop CS3 decides to turn on Snap To on, with layers and document bounds selected. I can turn if off, but this state is not saved, so every time I open a PSD file Snap To is on again, which I find very frustrating as I’m working with 300+ PSD files at a time, loading and saving them repeatedly. If there’s no way to make Snap To turn off permanently, I thought I’d write a script that at least went through all the open documents in PS3 and turned snap off in one fell swoop. Unfortunately I can’t find a way to refer to the Snap To status in AS, so I tried bringing each document to the front and having a keypress go off. Sadly for me, I can’t figure how to make each document come to the front.

Here is my script. Can anyone a) tell me how to make a document become the forefront document, and/or b) tell me a better way to tell PS to turn off Snap To? Many thanks in advance.

tell application “Adobe Photoshop CS3”
activate
set docnum to number of documents
repeat with i from 1 to docnum
tell document i
activate – I’m doing it wrong
tell application “Extra Suites”
type key “;” with command and shift
end tell
end tell
end repeat
end tell

Model: Mac Pro
AppleScript: Leopard 10.5.7
Browser: Camino
Operating System: Mac OS X (10.5)

Hi

If i was scripting this i would use GUI scripting, but first
i would assign a keyboard shortcut in photoshop to the command i wanted
then just call that command from within the script for example:

tell application "System Events"
	tell process "Photoshop" -- add your version here
		set frontmost to true
		keystroke "s" using command down-- just using the save shortcut as an example
	end tell
end tell

something similar to this should work with a bit of tweaking.

No CS3 for me so untested.

tell application "Adobe Photoshop CS2"
	activate
	set DocCount to count of documents
	repeat with i from 1 to DocCount
		set current document to document i
		tell document i
			tell application "System Events"
				tell process "Adobe Photoshop CS2"
					keystroke ";" using {shift down, command down}
				end tell
			end tell
		end tell
	end repeat
end tell