Re: How can I open attachment in Mail ?
Re: How can I open attachment in Mail ?
- Subject: Re: How can I open attachment in Mail ?
- From: kai <email@hidden>
- Date: Mon, 23 Oct 2006 18:53:10 +0100
On 23 Oct 2006, at 11:57, Philip Aker wrote:
On 2006-10-22, at 18:02:33, kai wrote:
on download_path()
set f to (do shell script "defaults read com.apple.mail
MailDownloadsPath") & "/"
if f does not start with "~" then return f
set h to POSIX path of (path to home folder)
if (count f) < 3 then return h
h & f's text 3 thru -1
end download_path
do shell script "echo 'puts [file nativename [exec defaults read
com.apple.mail MailDownloadsPath]]/' | tclsh"
Shorter, certainly (as one might expect from an all-shell approach) -
though not necessarily faster. (The original executes approximately
2.5 times faster here.) Adopting a slightly more verbose form, to
avoid the shell altogether, yields an even greater performance boost
(about 5 times faster than the one-liner):
------------------
on download_path()
set p to (path to preferences folder from user domain ¬
as Unicode text) & "com.apple.mail.plist"
tell application "System Events" to set f to value of ¬
property list item "MailDownloadsPath" of property list file p & "/"
if f does not start with "~" then return f
set h to POSIX path of (path to home folder)
if (count f) < 3 then return h
h & f's text 3 thru -1
end download_path
------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden