|
|
Using PDF Services, revisited
Here's a script which can prepare an attachment for Entourage, as well as fill in the name of the current window as the default name of the PDF file.
on open these_items
try
set this_file to item 1 of these_items
tell application "Finder"
set the file_name to the name of this_file
set the parent_folder to (the container of this_file) as alias
end tell
tell application (path to frontmost application as string)
repeat
set front_window_name to name of front window
-- display dialog "Enter a name for file:" default answer file_name
display dialog "Enter a name for file:" default answer (front_window_name)
set this_name to the text returned of the result
if this_name is not "" then exit repeat
end repeat
end tell
tell application "Finder"
set the name of this_file to this_name
set the target_file to ¬
(document file this_name of the parent_folder) as alias
end tell
tell application "Microsoft Entourage"
activate
set new_message to ¬
(make new outgoing message with properties ¬
{subject:"Interesting file", content:"This may be of interest", attachment:{file:target_file}})
open new_message
end tell
on error error_message number error_number
if the error_number is not -128 then
tell application (path to frontmost application as string)
display dialog error_message buttons {"OK"} default button 1
end tell
else
tell application "Finder" to delete parent_folder
end if
end try
end open
Using PDF Services, revisited
Ah thanks for this. Using your script I was able to parse the lines I needed to combine with balakera's script, and now I am prompted to (re)name the receipt before saving. And it defaults to the name of the current web window, as opposed to "Print Job.pdf"!
Okay, here goes:
---
Now is there any way for the default name to have a .PDF suffix? That would be ideal.
Using PDF Services, revisited
To answer your last question - yes, it is possible to have default name to have .PDF suffix.
Here is the script:
Using PDF Services, revisited
I'm total new to scripting and am copying and pasting and referencing a few docs here and there to get what I want to happen, so please take baby steps with me in any reply.
Using PDF Services, revisited
And for anyone who is using PowerMail here is the version that creates a new message with the PDF as an attachment:
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.06 seconds |
|