• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scripting Page Setup using Server Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Page Setup using Server Events


  • Subject: Scripting Page Setup using Server Events
  • From: Cameron Smith <email@hidden>
  • Date: Tue, 16 Dec 2003 16:31:35 -0800

Running under OS 10.2.x or 10.3.x, has anyone had success with scripting the standard Page Setup window using Server Events? It seems like such a basic, natural thing to do, that I'm surprised that I'm having trouble with it. I'm also surprised that I've found no reference to any attempts to do this on this list or anywhere else.

Although my ultimate goal is to script the printing of batches of pdfs from Acrobat, the Page Setup problem appears to be the same in Acrobat and Preview, so my example script here uses Preview. I've relied heavily on the UI Inspector and PreFab's UI Browser to get this far:

tell application "Preview" to activate
tell application "System Events"
tell process "Preview"
pick menu item "Page Setup" of menu "File" of menu bar item "File" of menu bar 1
click radio button 1 of radio group 1 of UI element 1 of UI element 3 of sheet "Page Setup" of window "1_Front_small.jpg"

set value of text field 1 of UI element 1 of UI element 3 of sheet "Page Setup" of window "1_Front_small.jpg" to "90"
value of text field 1 of UI element 1 of UI element 3 of sheet "Page Setup" of window "1_Front_small.jpg"
end tell
end tell

The first two commands work: the Page Setup menu command is chosen and the Page Setup sheet appears, and then one of the radio buttons in the Page Setup sheet is picked.

The third command (just below the blank line) should set the page to print at 90%. But the value never changes, either visually or in any sense "internally", as evidenced by the getting of the value, which returns the original, unaltered value.

Similarly, I can choose a menu item for the top pop up button (popup menu), but not for the other two.

Is this a well-known issue that I've just tuned out because I haven't needed it before? Or are others' experiences with Page Setup different than mine?

Thanks for any comments.

Cameron Smith
Cutting Edge Technology Services, Inc.
Nanaimo, BC
http://www.cetsi.com/
tel: 1.250.729.9515 fax: 1.250.729.8201
------------------------------------------------
Websites ** Print Production ** Editorial Services
Publishers of the http://SaltSpringNews.com/
------------------------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Elementary fie naming question (From: Bernard Azancot <email@hidden>)

  • Prev by Date: Re: Elementary fie naming question
  • Next by Date: Re: Scripting Excel
  • Previous by thread: Re: Elementary fie naming question
  • Next by thread: scriptting Excel
  • Index(es):
    • Date
    • Thread