Print to PDF work flow
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