Here's an example from a Photoshop file setup script I made:
--------------------------------------------------
-- page setup
--------------------------------------------------
tell application "System Events"
tell process "Adobe Photoshop CS3"
set frontmost to true
keystroke "p" using {command down, shift down} -- open Page Setup
dialog window
delay 1
keystroke tab
keystroke tab
repeat with idx from 1 to 16
key code 125 -- arrow down -- scroll down through the configured setups
end repeat
keystroke tab
keystroke 123 -- arrow left (to make sure landscape orientation is selected)
keystroke return
keystroke return
end tell
end tell
--------------------------------------------------
On 2008-08-07 19:10:10 -0400, abpp said:
> Is there a way to use Applescript to change the page setup/orientation
> (portrait or landscape) of a document in an application that doesn't
> have this built-in?? >> Stay informed about: SCRIPTING PAGE SETUP (ORIENTATION)