• 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: Print to PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print to PDF


  • Subject: Re: Print to PDF
  • From: Bill Cheeseman <email@hidden>
  • Date: Mon, 09 Jan 2012 17:38:31 -0500

Every once in a while I like to show off what GUI Scripting can do.

Open a test window in TextEdit, then run this script:

activate application "TextEdit"
tell application "System Events"
tell process "TextEdit"
-- insert GUI Scripting statements here
keystroke "p" using command down
set PDFButton to menu button "PDF" of sheet 1 of window 1
click PDFButton
click menu item "Save As PDF…" of menu 1 of PDFButton
delay 1
click button "Save" of window 1
end tell
end tell

The ellipsis in "Save as PDF..." is the ellipsis character, not three periods.

Filling in the Name field of the Save dialog is left as an exercise.

This runs on Mac OS X 10.7.2 Lion. I vaguely recall that I wrote a script just like this once before, so it probably works on earlier versions, too.


On Jan 9, 2012, at 4:48 PM, R. Nelson Byrne wrote:

Is there a way using AppleScript or Automator to print to PDF?

-- 

Bill Cheeseman - email@hidden

 _______________________________________________
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: Print to PDF
      • From: Joe <email@hidden>
References: 
 >Print to PDF (From: "R. Nelson Byrne" <email@hidden>)

  • Prev by Date: Re: Print to PDF
  • Next by Date: Re: Print to PDF
  • Previous by thread: Re: Print to PDF
  • Next by thread: Re: Print to PDF
  • Index(es):
    • Date
    • Thread