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: Paul Berkowitz <email@hidden>
- Date: Sun, 27 May 2001 09:37:46 -0700
On 5/27/01 6:39 AM, "Jan Pieter Kunst" <email@hidden> wrote:
>
>
I also didn't realize that I had to use the name of a path instead of the
>
name of a file.
'path to me' IS the name of a file. When you don't specify 'as string' then
it means 'as alias', and the result is an AppleScript alias (a file which is
identifiable even if it is moved from its present location), as in
alias "My Hard Disk:System Folder:Apple Menu Items:Turn Flash On"
You can save it in a property and even move the applet somewhere else, and
it will still be found. An AppleScript 'alias' does not have a 'name'
property, but this line is in a Finder tell block in Bill's script. The
Finder understands AppleScript aliases and translates it into its own 'file'
object. If you run that script to that point and look in the Event Log, it
will look like
file "Turn Flash On" of folder "Apple Menu Items" of folder "System
Folder" of disk "My Hard Disk" of application "Finder"
So it _is_ a file which does have a name property in the Finder, namely
"Turn Flash On", which can be changed to "Turn Flash Off".
--
Paul Berkowitz