Re: FADE DEAD
Re: FADE DEAD
- Subject: Re: FADE DEAD
- From: Jon Pugh <email@hidden>
- Date: Fri, 15 Mar 2002 14:12:42 -0800
At 10:43 AM +0100 3/15/02, JJ wrote:
>
Then, another question relative to storage. Why does it store full paths
>
when you make a reference to a file or when using a tell block.
>
>
Ie
>
>
tell app "Finder" to...
>
>
will be stored as
>
>
MACS (creator flag) Finder (app name) JJ:System Folder:Finder (full path
>
within MY DISK)
>
Is this the reason because the typhical question "where is located app xxx"
>
when running the script in other computer?
Actually, AppleScript is storing an alias, which happens to keep a full path along with a bunch of other information. An alias is about 500 bytes.
When the alias goes bad, then AppleScript uses the creator type to search the running process list and the desktop database, and then if nothing (or multiple apps?) is found it asks the user.
>
And about storing properties... An example:
>
>
property x : read (":file.txt" as alias)
>
-- "file.txt" contains word "HELLO"
>
display dialog x
>
>
Obviously, when I delete the "file.txt", the script runs as normally, and
>
displayes dialog "HELLO".
>
So, embedding commands into properties only work at compile time?
Yes, and the initial value is the only value that is decompiled. In other words, if you change a property at runtime, it will be saved in the script, but if you edit the script you will always see the initial value, regardless of whether it has been changed (and if you compile you will lose the saved value).
>
Let's supposse that "file.txt" was the "Neverending Story". If I want mail
>
the script it could be an amount of many minutes sending many MB... :-).
>
Then, what's the difference between
>
>
property x : read (":file.txt" as alias)
>
>
&
>
>
property x : "HELLO"
One looks in the file at compile time. The other always stuffs HELLO in there, regardless of what the file contains.
Jon
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.