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

Print to PDF work flow


  • Subject: Print to PDF work flow
  • From: Joe <email@hidden>
  • Date: Sat, 1 Nov 2008 10:06:23 -0700

Apple provides an example of a PDF work flow that attaches a PDF to an outgoing Mail message. In the example, the resulting file gets generically named as "Print Job.PDF." Has anyone found a way to get the name of the document being printed to be the name of the attached PDF?

--Apple's example:
on open these_items
 tell application "Mail"
  set composeMessage to (make new outgoing message with properties {visible:true})
  tell composeMessage
   tell content
    repeat with aFile in these_items
     make new attachment with properties {file name:aFile} at before the first character
    end repeat
   end tell
  end tell
 end tell
end open

I clumsily tried this and variations on it:

on open these_items
 tell application "System Events"
  set x to name of first process whose frontmost is true
 end tell
 tell application y to set theName to name of window 1
 tell application "Mail"
  set composeMessage to (make new outgoing message with properties {visible:true})
  tell composeMessage
   tell content
    repeat with aFile in these_items
     tell application "Finder"
      set name of aFile to y & ".pdf"
     end tell
     make new attachment with properties {file name:aFile} at before the first character
    end repeat
   end tell
  end tell
 end tell
end open

Joe
 _______________________________________________
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 work flow
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: Ejecting An Image Disk
  • Next by Date: Re: Ejecting An Image Disk
  • Previous by thread: Re: Ejecting An Image Disk
  • Next by thread: Re: Print to PDF work flow
  • Index(es):
    • Date
    • Thread