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


Click here to return to the 'A script to open PopFile from Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to open PopFile from Mail.app
Authored by: ssevenup on Dec 19, '03 01:13:25PM
Cool idea :-) So first I should identify myself as the developer of the POPFile Package installer for OSX. Sorry it's not available as a download from SF yet. I have been dragging my feet and I'm not that familiar with CVS. I do have working Package, but it's not the current version.

Now to the business at hand...

This Applescript didn't work for me on Panther, but I have not tested it on Jaguar. I get the following when I run it...

tell application "Mail"
	get selection
		{message 41 of mailbox "Work"}
	get content of header "x-popfile-link" of message 41 of mailbox "Work"
		"http://127.0.0.1:8080/jump_to_message?view=popfile47323=47.msg"
	(*PopFile: ttp://127.0.0.1:8080/jump_to_message?view=popfile47323=47.ms*)
end tell
tell application "Safari"
	open location "ttp://127.0.0.1:8080/jump_to_message?view=popfile47323=47.ms"
end tell

So it truncates the beginning and end of the URL. With the following changes it works for me.

using terms from application "Mail"
	on perform mail action with messages incomingMessages
		set logString to "" & return
		
		tell application "Mail"
			repeat with msg in incomingMessages
				set popFileLink to (content of header ¬
					"X-Popfile-Link" of msg)
				set popFileLink to (characters 1 through ¬
					(count of popFileLink) of popFileLink)
				log "PopFile: " & popFileLink
				tell application "Mozilla Firebird" to open location ¬
					(popFileLink as string)
			end repeat
		end tell
		
	end perform mail action with messages
	
	on run
		tell application "Mail" to set sel to selection
		tell me to perform mail action with messages sel
	end run
end using terms from

Never mind the different browser, I just don't use Safari. I consider myself an Applescript dummy, but these changes worked for me.

---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.

[ Reply to This | # ]

A script to open PopFile from Mail.app
Authored by: huzzam on Dec 23, '03 04:38:58PM

thanks for the submission & the fix! & thanks to apple for making keyboard shortcuts editable in panther!



[ Reply to This | # ]