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


Click here to return to the 'Use iCal to set a response reminder for a Mail message' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use iCal to set a response reminder for a Mail message
Authored by: mark hunte on Jul 06, '05 07:39:18PM
This seems to work, I created a mailbox called 'reminders' for the messages to be either
moved or duplicated to. The script shows how to get the url for the email , which can then be place in the url of the iCal event.
I will post an updated version of the full script later with this included. ( i need to go to bed)
tell application "Mail"
	set theCount to ""
	set selectionMessage to selection
	set thisMessage to item 1 of selectionMessage
	
	set the_mailbox to mailbox "reminders"
	set new_place to duplicate thisMessage to the_mailbox -- you can change duplicate to move
	set theCount to count messages in the_mailbox --this is just to get the path to the new mailbox
	set themessage to message theCount of the_mailbox -- this is just to get the path to the new mailbox
	set theId to id of themessage as string
	using terms from application "Finder"
		set the_Url to do shell script "mdfind \"kMDItemKind == 'emlx' \"| grep -iw " & theId & ".emlx" & " | grep -v grep " as string
		set the_delim1 to do shell script "echo " & quoted form of the_Url & " " & " |awk -FMessages '{print $1}'"
		set copy_folder to the_delim1 & "Messages/"
		set the_Url to "file://" & copy_folder & (do shell script "cd " & quoted form of copy_folder & " ; ls -t1| perl -pe 'exit if $. > 1'")	
	end using terms from
	
end tell

---
mh

[ Reply to This | # ]