Hi everyone,
I am trying to control zoom level in Photoshop CS5.
It’s not directly scriptable, but I’m really close to doing it through GUI scripting. I can insert my desired zoom level (right now it’s 100%, but that will vary later) into the zoom level box below the photo, and then…
I need to be able to press enter in order for Photoshop to actually read and use the value. I’ve tried using “keystroke return” and “keycode 36”, but I might not be using it in the right place. Anyone have any ideas?
Here’s what I have so far:
tell application "Adobe Photoshop CS5"
set docName to name of current document
end tell
tell application "System Events"
set windowList to name of every window of application process "Adobe Photoshop CS5"
set i to 1
set listLength to count of windowList
repeat until i = 0
if text item i of windowList contains docName then
set docWindow to text item i of windowList as string
set i to 0
else if i = listLength then
set i to 0
else
set i to i + 1
end if
end repeat
set zoomBox to text field 1 of window docWindow of application process "Adobe Photoshop CS5"
set value of zoomBox to "100%"
end tell
Thanks so much. Love MacScripter.
Alex