• 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
GUIscritpting, Pages and PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUIscritpting, Pages and PDF


  • Subject: GUIscritpting, Pages and PDF
  • From: KOENIG Yvan <email@hidden>
  • Date: Thu, 24 Jan 2008 19:16:30 +0100

Hello

Trying to help a correspondant, I try to write a handler able to
open a Pages document
print it in a compressed PDF file

Here I am:

property theApp : "Pages"

set p2d to path to desktop as Unicode text
set p2Doc to (p2d & "test4pdf.pages") as alias
tell application theApp
activate
open p2Doc

tell application "System Events" to tell application process theApp
keystroke "p" using {command down} (* print *)
set wName to get name of first window whose subrole is "AXStandardWindow"
click menu item 5 of menu 1 of menu button "PDF" of sheet 1 of window wName

end tell -- System Events …
end tell --theApp


(*

I get this report:

tell current application
path to desktop as Unicode text
"Macintosh HD:Users:yvankoenig:Desktop:"
end tell
tell application "Pages"
activate
open alias "Macintosh HD:Users:yvankoenig:Desktop:test4pdf.pages:"
end tell
tell application "System Events"
keystroke "p" using {command down}
get name of window 1 of application process "Pages" whose subrole = "AXStandardWindow"
"test4pdf.pages"
get properties of menu 1 of UI element 5 of UI element 4 of sheet 1 of window "test4pdf.pages" of application process "Pages"
"Erreur dans System Events : NSReceiverEvaluationScriptError: 4"
*)



(* I am running under 10.4.11 The UI Browser description is: PATH TO ELEMENT: application "Pages" fenêtre standard "test4pdf.pages" (window 1) feuille "Imprimer" (sheet 1) [MISMATCH] bouton de menu "PDF" (menu button -2147483648) menu (menu 1) commande de menu "Compresser le document PDF" (menu item 5) but the click … doesn't works *)

Is one of you able to explain what is wrong ?

Yvan KOENIG _______________________________________________
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
  • Follow-Ups:
    • Re: GUIscritpting, Pages and PDF
      • From: "John C. Welch" <email@hidden>
    • Re: GUIscritpting, Pages and PDF
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: Mail.app Attachments Filter
  • Next by Date: Re: Mail.app Attachments Filter
  • Previous by thread: Re: Mail.app Attachments Filter
  • Next by thread: Re: GUIscritpting, Pages and PDF
  • Index(es):
    • Date
    • Thread