• 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: "path to me" vs ":"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "path to me" vs ":"


  • Subject: Re: "path to me" vs ":"
  • From: email@hidden
  • Date: Sat, 8 Dec 2001 23:50:04 EST

Kirk,

Not bad. I shortened your approach to

tell application "Finder" to set mypath to (folder of (path to me)) as string

and then quickly realized why I haven't used such things - the (classic)
Finder is slooooow. The above line takes 0.35 seconds to execute with Mac OS
9.1 (500MHz G3).

However......

It takes only 0.012 seconds with MacOSX 10.1.1 (400MHz G4) !! Amazing! A 30
fold speed-up. Now we're getting somewhere. I can actually think about using
the Finder in CGI scripting (where execution time is measured in fractions of
ticks).

Of course, ":" as file specification as string is 10 times faster still.

Jeff Baumann
email@hidden
www.linkedresources.com

cc please, on digest


In a message dated 12/8/01 12:36:17 PM, Kirk Kerekes wrote:

>A simple means of replacing the ":" trick with "path to me" when you want
>the path to the enclosing folder is:
>
> set myalias to (path to me)
> tell application "Finder"
> set mypath to folder of myalias
> end tell
> set mypath to mypath as string
>
>This is shorter than using Text Item Delimiters to lop off the end of the
>path, and has the advantage of not assuming the path delimiter.


  • Prev by Date: Re: URL Access Scripting
  • Next by Date: Re: "path to me" vs ":"
  • Previous by thread: Re: "path to me" vs ":"
  • Next by thread: Re: "path to me" vs ":"
  • Index(es):
    • Date
    • Thread