• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How can I open attachment in Mail ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: How can I open attachment in Mail ?
      • From: kai <email@hidden>
    • "~" vs. "POSIX file"
      • From: Christopher Nebel <email@hidden>
References: 
 >How can I open attachment in Mail ? (From: Victor Frenklakh <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)

  • Prev by Date: Re: Scripting Capture of an Internet Connect Window?
  • Next by Date: Re: Scripting Capture of an Internet Connect Window?
  • Previous by thread: Re: How can I open attachment in Mail ?
  • Next by thread: "~" vs. "POSIX file"
  • Index(es):
    • Date
    • Thread