Re: Can a script change its own name?
Re: Can a script change its own name?
- Subject: Re: Can a script change its own name?
- From: Bill Briggs <email@hidden>
- Date: Sun, 27 May 2001 11:09:39 -0300
At 3:39 PM +0200 27/05/01, Jan Pieter Kunst wrote:
Indeed, that works. I experimented with "me" in the Script Editor first, but
I noticed that it seemed to refer to the Script Editor application instead
of the script. I didn't realize that the referent of "me" would probably
change if the script was saved as an application.
Yes, "me" becomes the script application itself when you save it and
run it that way. Running such a script in Script Editor while it's
open is destined to error.
I also didn't realize that I had to use the name of a path instead of the
name of a file.
By using "path to me" the thing will always find itself no matter
where you move it. Storing the name in a property means your script
remembers in which direction it toggled things last.
- web