• 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: loading scripts from a relative path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading scripts from a relative path?


  • Subject: Re: loading scripts from a relative path?
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 27 May 2013 08:35:05 +1000

On 27/05/2013, at 6:51 AM, Alex Hall <email@hidden> wrote:

> 1. If I use Finder, is there really much of a performance hit, or am I worried about nothing?

If you're doing it once or twice, it's mostly not worth worrying about. But if the Finder is busy doing something else, there can be a delay -- in some case considerable. It doesn't strike me as worth the bother when there's an easy alternative.

> 2. If Finder is a bad idea to use that often, how else could I get the relative path to the script?
>
> Yes, I can write a load function that grabs "path to me", breaks it up by colons, then gives me all but the last (thereby giving me "path to me" without the script name) but that's hardly reusable.

Why is it not reusable? That's precisely what most people use.

> I'll do that if I have to, and leave that handler in every script, but a native solution would be cleaner and, I suspect, a bit faster.

I'm not sure how you can compare the speed of something that doesn't exist, but you may well be surprised how little time using text item delimiters to do the job takes. Judging the speed of AS code by appearances will lead you up the garden path very quickly.


--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: loading scripts from a relative path?
      • From: Alex Hall <email@hidden>
References: 
 >loading scripts from a relative path? (From: Alex Hall <email@hidden>)

  • Prev by Date: Re: loading scripts from a relative path?
  • Next by Date: Re: loading scripts from a relative path?
  • Previous by thread: Re: loading scripts from a relative path?
  • Next by thread: Re: loading scripts from a relative path?
  • Index(es):
    • Date
    • Thread