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: Philip Aker <email@hidden>
- Date: Tue, 24 Oct 2006 00:35:07 -0700
On 2006-10-23, at 10:53:10, kai wrote:
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):
I agree that in general, it's much better to stick to the same
language if possible.
But it's unfair to compare timings for mixed call scripts in Script
Editor. The test in that case is to run them a 1000 times in
Terminal via osascript/tclsh/perl/pythonw/ruby because then the load
factors while not equal, are on more of an even footing. For
instance if I was to run the same solution favoring the Tcl calls in
a Tk application, or a stay open TclOSA applet then the Tcl binary
would already be loaded and its alien load factors would be that of
TclAppleScript/ascr and maybe 'defaults'. Similarly for Perl,
Python, and Ruby environments with their AppleScript or appscript
solutions.
Anyway, my indirect point was that AppleScript ought to be able to do
tilde expansion on a POSIX file cast.
POSIX file "~/Desktop/some.txt"
--> file ":~:Desktop:some.txt"
As to whether or not Mail should supply the full path, I'm not sure.
It could be an advantage for transferring the prefs file across
installations.
Philip Aker
email@hidden
_______________________________________________
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