Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Using PDF Services, revisited' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Using PDF Services, revisited
Authored by: balakera on Dec 27, '04 03:14:13PM
And for anyone who is using PowerMail here is the version that creates a new message with the PDF as an attachment:

on open these_items
		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)
			set front_window_name to name of front window
				display dialog "Enter a name for file:" default answer (front_window_name & "." & "pdf")
				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 "PowerMail 5.1"
			set the new_message to 
				make new message with properties {content:" "}
			make new attachment at new_message with properties {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
			tell application "Finder" to delete parent_folder
		end if
	end try
end open

[ Reply to This | # ]