Re: Where am I?
Re: Where am I?
- Subject: Re: Where am I?
- From: email@hidden
- Date: Sun, 1 Apr 2001 14:27:06 EDT
In a message dated 4/1/01 1:23:06 AM, Nick Quinn wrote:
>
Hi,
>
>
Some of my scrips are a bit mobile and get tested on one machine then used
>
on another. Instead of hard-coding the path to the folder they work on, I
>
would like simply to put the script in that folder and let it do something
>
like:
>
>
set pathToScript to the path of this script
>
>
Then fiddle with the text to get the folder path. This obviously doesn't
>
work. RTBM "5/5/99 Language Guide" doesn't enlightened me.
>
>
Anyone any suggestions, please?
I'm sure you'll see a dozen good responses before mine gets thru (sometimes
my posts don't come thru for 24 hours - and it's not just because I'm on the
digest).
What you want is
-- gives the full path, including the script name
set pathToScript to (path to me) as string
or (from Motoyuki Tanaka, who, with lots and lots of encouragement, may be
persuaded to upgrade his osax for PPC/OSX)
-- gives the path to the folder containing the script
set pathToFolderOfThisScript to (":" as alias) as string
Be aware that running these in Script Editor will give the path to Script
Editor, and running them from various script menus may give varying results.
But for a stand-alone applet, it works nicely.
Jeff Baumann
email@hidden
www.linkedresources.com
I don't need a job. I have a job. What I need is an income.