• 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
Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF


  • Subject: Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
  • From: "koenig.yvan" <email@hidden>
  • Date: Mon, 04 Nov 2013 16:24:40 +0100

(*
Cumbersome code to be sure that we use the new application,
not the old one which is "/Applications/iWork '09/Pages.app".
In this script grabbing the process ID wasn't required but the skeleton was grabbed from a script in which it was.
*)

tell application "/Applications/Pages.app"
activate
if version < "5" then error "You aren't running Pages version 5.x"
end tell
tell application "System Events" to tell (first process whose frontmost is true)
set procID to its id
set dName to name of window 1
end tell -- System Events

if dName ends with ".pages" then
set pdfName to (text 1 thru -6 of dName) & "pdf"
else
set pdfName to dName & ".pdf"
end if

tell application "System Events" to tell (first application process whose id is procID)
set nbw to count windows
keystroke "p" using command down
(*
Wait for the availability of the print sheet *)
repeat
if exists sheet 1 of window 1 then exit repeat
end repeat
#name of menu buttons of sheet 1 of window 1
--> {"PDF"} but I don't know if it's spelled this way worldwide
tell sheet 1 of window 1
set cntUIitems to count UI elements
set PDFButton to first menu button
end tell
click PDFButton
# name of menu items of menu 1 of PDFButton
--> {"Ouvrir le PDF dans Aperçu", "Enregistrer au format PDF…", "Enregistrer au format PostScript…", "Faxer le document PDF…", missing value, "@ PDF-BAT.qfilter", "@ PDF-prépresse CMJN.qfilter", "@ PDF-web.qfilter", "@ PDFX3-ISO.qfilter", "Add PDF to iTunes", "Envoyer le document PDF par courrier électronique", "Enregistrer le document PDF dans le dossier de reçus web", missing value, "Modifier le menu…"}
click menu item 2 of menu 1 of PDFButton
(*
Wait for the availability of the save in PDF file sheet *)
repeat
if (count UI elements of sheet 1 of window 1) ≠ cntUIitems then exit repeat
end repeat
(*
Set the name of the new PDF *)
set value of text field 1 of sheet 1 of sheet 1 of window 1 to pdfName
keystroke "d" using command down # set destination folder to Desktop
keystroke return
end tell

Oops, I read too fast, I wrote a script allowing us to print a Pages version 5 document in a PDF

Here it is and maybe it will be useful for someone.

Yvan KOENIG (VALLAURIS, France) lundi 4 novembre 2013 16:24:33


 _______________________________________________
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: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
      • From: "koenig.yvan" <email@hidden>
References: 
 >Pages 4.3 and Mavericks - Can't export as PDF (From: Lists <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Shane Stanley <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Lists <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Shane Stanley <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Bryan Harris <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Shane Stanley <email@hidden>)
 >Re: Pages 4.3 and Mavericks - Can't export as PDF (From: Alex Zavatone <email@hidden>)
 >Re(2): Pages 4.3 and Mavericks - Can't export as PDF (From: JF <email@hidden>)

  • Prev by Date: Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
  • Next by Date: Re: AppleScript-Users Digest, Vol 10, Issue 387
  • Previous by thread: Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
  • Next by thread: Re: Re(2): Pages 4.3 and Mavericks - Can't export as PDF
  • Index(es):
    • Date
    • Thread