Re: Whither went the ":" and strange behavior...
Re: Whither went the ":" and strange behavior...
- Subject: Re: Whither went the ":" and strange behavior...
- From: Daniel Rodrigue <email@hidden>
- Date: Wed, 19 Dec 2001 10:33:07 -0500
Corny wrote:
>
Over the last several days (and following a complete software
>
reinstall) several of my scripts stopped working. In every case the
>
problem was the compiled scripts "forgetting" one of the colons in an
>
alias spec. Do scripts age? These had been around 3 - 4 years.
>
Perhaps like old trees that lose leaves, old scripts lose colons?
I don't have "the" solution but hereafter my observation.
All the following started after I did install 9.2.2 (i.e. Applescript
1.7).
First, I'm using coloring syntax and I found strange to see every path
description conforming to the following: alias "disk:folder:file",
changing
color. Usually a string is orange for me and out of the sudden the path
description of an alias turn to black as well as changing font from my
original coloring/font prefs syntax. That was my first visible
observation.
I'm using disk image to simulate server volume so I can work remote
without
the server presence.
Then, and here is Corny problem, I found that when ever the volume where
the
alias path was pointing was missing (when I forgot to mount my dummy
server)
the the first (and sometime the last) colon of the path disappear. And for
some strange reason there was no error message because such alias doesn't
exist but of course you can no longer use your script.
Further more, here is a little exercise you can try. It is astonishing!
1- Create an item (either file of folder) on the desktop.
2- Script the following:
tell application "Finder"
activate
set theItem to alias "YourDiskName:Desktop folder:YourItemName"
-- or for OSX: alias
"YourDiskName:Users:YourUserName:Desktop:YourItemName:"
set {theName, theParent} to {theItem's name, name of theItem's container}
display dialog "The item name: " & theName & return & "The parent name:
" & theParent
end tell
3- run; you should get "YourItemName" and "Desktop folder" as returned
name.
4- (here is the mystery...) Change the name of "YourItemName". And, as any
good magic trick, move the item where ever you want, as deep as you
want
in your hard disk.
5- Run the script again. Magic, your script still call the old path name
but still can find the item where ever it is what ever ever is the new
name!
That is acting like a "real" alias now. Before 1.7 we couldn't do that.
The alias path had to be "valid" in fact "alias path" was more like a file
path tie to the item.
Any explanation someone?
And by the mean time anybody could tell me how to "colorize" my syntax for
the "new alias" path description? I don't like the "Geneva 12 Black" look
in my nicely chosen color syntax color...
Best regards,
Dan
- - - ----------------------------------------------------- - - -
Daniel Rodrigue / Simple & Logik
Vox: 450-468-5726 Fax: 450-4-685087 Bip: 514-897-8698
1261 rue Bourgeoys, Longueuil (Quebec) Canada J4M 1Z5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~