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

A script to open PopFile from Mail.app Apps
If you use the PopFile application for mail filtering, you can use this script from within Mail to open up the current message in PopFile. This is handy for changing the classification of the message.

To use, you first need to turn X-POPFile-Link Header to On in the Configuration area of Popfile. Then install the below script into your ~Library/Scripts/Mail folder.

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 2 through ¬
       ((count of popFileLink) - 1) of popFileLink)
      log "PopFile: " & popFileLink
      tell application "Safari" 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
[robg adds: I haven't tested this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,431 views]  

A script to open PopFile from Mail.app | 5 comments | Create New Account
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 | # ]
Here's a version for Entourage
Authored by: qoo77 on Dec 19, '03 09:58:31PM
A script to open PopFile from Mail.app
Authored by: kopf on Dec 19, '03 10:49:06PM

I'm using Eudora 5.x and all I have to do is command-click or double click on the popfile header in the message. It is marked as an active URL in blue and underlined like other URLs in Eudora.

Am I missing something?

Klaus



[ Reply to This | # ]
A script to open PopFile from Mail.app
Authored by: deppix on Dec 21, '03 03:48:24PM

Same for me in Eudora 6.

deppix



[ Reply to This | # ]