• 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
dot dot dot
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dot dot dot


  • Subject: dot dot dot
  • From: "R. Nelson Byrne" <email@hidden>
  • Date: Fri, 09 Mar 2012 17:43:23 -0800

Thanks to all for your generous AppleScript help.

In particular I benefitted from answer as to how to print to PDF. In Vol 9, Issue 10 Bill Cheeseman showed off what GUI Scripting can do, and in Issue 11 Yvan Koenig amplified on the topic. 

I found a problem, though, working with Graphic Converter (a wonderful program!). I had been using numbers to select the proper menu items, like so:
#=====================================
--Now do Page Setup
tell menu bar 1
tell menu bar item 3 --"File", in English
tell menu 1 --menu for above menu bar item
get menu items
click menu item 31 --i "Page Setup…", in English
end tell --menu 1
end tell --menu bar item 3
end tell --menu bar 1

-- The Page Setup screen is going to come down on the front window, talk to it.
tell front window
repeat with loop from 1 to maxLoop --wait until sheet appears
if (count sheets) is not 0 then exit repeat
delay 1
end repeat
if (count sheets) is not 1 then error "Sheet Page Setup never appeared!"
tell sheet 1
tell radio group 1 to click radio button 1 -- portrait layout
click button 1 -- "OK", in English
end tell --sheet 1
end tell --Front window

#=====================================
--Now Print to PDF
tell menu bar 1
tell menu bar item 3 --"File", in English
tell menu 1 --menu for above menu bar item
click menu item 32 -- "Print…", in English
end tell --menu 1
end tell --menu bar item 3
end tell --menu bar 1
--The Print screen is going to come down on the front window


A  recent update to Graphic Converter broke that by bumping the menu items by 1, so I tried to use the English tags. As written below, that failed.
#=====================================
--Now do Page Setup
tell menu bar 1
tell menu bar item 3 --menu bar "File", in English
tell menu 1 --menu for above menu bar item
get menu items
click menu item "Page Setup…"
end tell --menu 1
end tell --menu bar item 3
end tell --menu bar 1

-- The Page Setup screen is going to come down on the front window, talk to it.

 etc. as above then:

#=====================================
--Now Print to PDF
tell menu bar 1
tell menu bar item 3 --menu bar "File", in English
tell menu 1 --menu for above menu bar item
click menu item "Print…"
end tell --menu 1
end tell --menu bar item 3
end tell --menu bar 1
--The Print screen is going to come down on the front window

 As I found out, it was because one must use "Page Setup..." (three full stops) but "Print…" (a horizontal ellipsis).

Isn't this strange? I haven't tested, but I assume this is peculiar to GC.

Cheers all
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Pull e-mail address from Mail.app
  • Next by Date: shell script 'touch' problem
  • Previous by thread: Re: Pull e-mail address from Mail.app
  • Next by thread: shell script 'touch' problem
  • Index(es):
    • Date
    • Thread