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


Click here to return to the 'Link files to iCal events' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Link files to iCal events
Authored by: sethd on Dec 16, '05 10:41:30AM
Here's a great applescript for linking a message in Mail.app to an iCal event:

http://discussions.apple.com/thread.jspa?messageID=1029973

And here is the code recopied for convenience. Just save as an application with the Script Editor:

-- Find Email File Path --
-- John Maisey --
-- Will only work in OS 10.4 or later --
-- 0.4
-- 22 Aug 2005
-- What it does:
-- Sets the clipboard to the path of the first selected email message to paste into iCal's URL field. This method will only work if you do not move the message to another folder in Mail.app.
--
-- Fixed to deal with quotes in email subject (24/8/5)
-- Fixed to deal with unusually set TID's (24/8/5)
-- Fixed to deal with various time formats (26/8/5)
-- Changed search from date to ID (26/8/5)
-- Added Python script to url encode file path (26/8/5)

tell application "Mail" to set mailList to selection
try
tell application "Mail" to set {myTitle, myID} to {subject, id} of item 1 of mailList
on error
display dialog "Check that you have an email selected in Mail.app" buttons {"OK"}
return
end try

set {myDels, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {"""}}
set myTitle to text items of myTitle
set AppleScript's text item delimiters to {"""}
set myTitle to myTitle as text
set AppleScript's text item delimiters to myDels

set someEmails to paragraphs of (do shell script "mdfind "kMDItemTitle == '" & myTitle & "' && kMDItemKind == 'emlx'"")
repeat with anEmail in someEmails
if anEmail contains myID then exit repeat
end repeat
set myFile to do shell script "python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of anEmail
try
set the clipboard to "file://" & POSIX path of myFile
on error
display dialog "file not found" buttons {"OK"}
return
end try
display dialog "-- Find Email File Path --" & return & return & "The clipboard contains the file path." & return & "Paste this into the iCal URL field." buttons {"OK"}
--

---
http://www.fictionalpeople.com

[ Reply to This | # ]

Link files to iCal events
Authored by: smorr on Jan 19, '06 07:11:12AM
I am working on a new version of MailTags which will link mail messages to ical to do's (So from a message, you can create, alter, delete to do items) Clicking on the url in ical will open the mail message in question.

Also the link is 2 ways so that changes to an item in ical will update the message in mail when you revisit the linked message.

For more details you can visit a teaser post on Tim Gaden's excellent hawkwings site

[
Reply to This | # ]