• 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: iWorks Pages "Print" dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iWorks Pages "Print" dialog


  • Subject: Re: iWorks Pages "Print" dialog
  • From: KOENIG Yvan <email@hidden>
  • Date: Fri, 16 Sep 2011 10:59:08 +0200

No need for GUIScripting

set p2d to path to desktop as text
tell application "Pages"
set file_name to name of document 1
if file_name ends with ".pages" then
set pdfName to (text 1 thru -6 of file_name) & "pdf"
else
set pdfName to file_name & ".pdf"
end if
-- convert it
save document 1 as "SLDocumentTypePDF" in (p2d & pdfName)


end tell

A similar script apply to Numbers.

set p2d to path to desktop as text
tell application "Numbers"
set file_name to name of document 1
if file_name ends with ".pages" then
set pdfName to (text 1 thru -6 of file_name) & "pdf"
else
set pdfName to file_name & ".pdf"
end if
-- convert it
save document 1 as "LSDocumentTypePDF" in (p2d & pdfName)


end tell

Only Keynote requires GUIScripting.
In this case, given what we really want to achieve we must trigger
Export as PDF
or
Print in a PDF

Yvan KOENIG (VALLAURIS, France) vendredi 16 septembre 2011 10:59:02


 _______________________________________________
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: iWorks Pages "Print" dialog
      • From: "email@hidden" <email@hidden>
References: 
 >iWorks Pages "Print" dialog (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: DiskImageMounter
  • Next by Date: Re: iWorks Pages "Print" dialog
  • Previous by thread: Re: iWorks Pages "Print" dialog
  • Next by thread: Re: iWorks Pages "Print" dialog
  • Index(es):
    • Date
    • Thread