Photoshop CS3 Interface Scripting?

Is it possible to use applescript to control the workspace, image zoom, screen view and proof setup view in CS3? I see a lot of scripts showing how to manipulate a document or the document preferences, but the scripting guide doesn’t seem to mention scripting the interface. Basically, on opening an image I need to go to full screen, hide palettes, set the zoom to a certain percentage and apply a custom proof set up, hopefully before the image appears on screen. Anyone have any examples of any of these functions?

thanks

Interestingly I don’t see anything to control those things. You can use system events:

tell application "System Events"
	tell process "Adobe Photoshop CS2"
		keystroke "f"
		keystroke "f"
		keystroke tab
		keystroke "0" using command down
		keystroke "y" using command down
	end tell
end tell

Add custom keyboard shortcuts for those item that don’t have them that you want to control and it should not be too hard to get PS to do what you want.

Hm. Interestingly, you can control those items using javascript, but I can’t make heads or tails of most of the javascript… Thanks for the tip on using system events, guess I’ll try that way.

This works… sort of.


set theImage to choose file with prompt "Select the Image"

tell application "Adobe Photoshop CS3"
	open theImage showing dialogs never
end tell

tell application "Adobe Photoshop CS3" to activate
tell application "System Events"
	tell application process "Adobe Photoshop CS3"
		keystroke "0" using {option down, command down}
		keystroke "-" using {command down}
		keystroke "-" using {command down}
		keystroke "-" using {command down}
		keystroke "-" using {command down}
		keystroke tab
		keystroke "f"
		keystroke "f"
		keystroke "y" using {command down}
	end tell
end tell

Of course the issue is that this just toggles the state of the interface, instead of setting it to a certain state everytime. Wonder if you can access the stuff using Ruby instead of javascript…