Re: Mail scripting
Re: Mail scripting
- Subject: Re: Mail scripting
- From: John Delacour <email@hidden>
- Date: Wed, 13 Aug 2003 00:23:27 +0100
At 11:17 pm +0100 12/8/03, John Delacour wrote:
using terms from app "Mail"
on perform mail action with messages ls
repeat with msg in ls
set {s, i} to {source, message id} of msg
set fu to "/tmp/" & i
set f to POSIX file fu
open for access f with write permission
write s to f
close access f
do shell script "open -e " & quoted form of fu
end
end
end
I see that since TextEdit is almost as hopeless as Mail, the windows
it opens as a result of this rule may be blank, though the content
exists in the file, so it's best to use another editor which is
guaranteed to show the content. Here's how to get the candidate
messages to open in BBEdit:
property BBEdit : ""
using terms from application "Mail"
on perform mail action with messages ls
if BBEdit is "" then
tell application "Finder"
name of application file id "R*ch"
set BBEdit to space & quoted form of result & space
end tell
end if
repeat with msg in ls
set {s, i} to {source, message id} of msg
set fu to "/tmp/" & i
set f to POSIX file fu
open for access f with write permission
write s to f
close access f
do shell script "open -a" & BBEdit & quoted form of fu
end repeat
end perform mail action with messages
end using terms from
.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.