Re: Error-trapping alias properties
Re: Error-trapping alias properties
- Subject: Re: Error-trapping alias properties
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 30 Mar 2002 08:25:38 -0800
On 3/30/02 7:18 AM, I wrote:
>
On 3/30/02 1:41 AM, "Andy Wylie" <email@hidden> wrote:
>
>
> ------------------
>
> property someFile : "excuse me"
>
>
>
> try
>
> (someFile as string) as alias
>
> display dialog someFile as text
>
> on error
>
> set someFile to choose file with prompt "%0 isagonner-->" & (someFile)
>
> end try
>
>
>
> ------------------
>
>
>
> do you need the reference?
>
> Can you confirm this will or not suffice?
>
>
It will! Sorry, Andy. This does the same thing much more succinctly. I've
>
tried it both in and between OS 10.1.3 and 9.2.2
A reflection and a discovery:
1) This means, of course, that my first premise was wrong: the alias to a
non-existent alias was not barring the door, ever. That's where those
conflated disk names must come into play. I hope this isn't another bug
that's going to fixed some day, since it's very handy, but rather a
far-sighted intentional implementation. (If it is ever taken away, then
Paul's 'a reference to' might come into its own and still work. Hard to
know.)
2) [OT] I've been testing the "switch computers" scenario with my G3 desktop
and iBook, one booted from OS 9.2.2, the other from 10.1.3. Sometimes I link
these two by ethernet hub (when they're in the same place, as at the moment)
or by TCP/IP (when they're in different places). The desktop is currently
running 9.2.2 and is set to the local "fake" IP address of 10.1.2 since I
don't have a router and can connect only one computer at a time to the
internet via static-IP address ADSL through the same ethernet hub. The iBook
is currently running 10.1.3, connected to internet at one single static IP
address.
OK. When I tested by moving a script from the OS X iBook to the OS 9 G3, the
script, as hoped for, went into the "error" mode and asked for a new file to
set as script property. After doing so an checking all was OK with the new
alias property, I moved the script back to the OS 10.1.3 iBook. Here, the
"Connect to server" dialog came up, wanting my password to the other
computer! The iBook could identify the alias on the other computer as being
on a remote "server" that it has once been connected to, even though, at the
moment, the iBook itself is not on that same network! (I.e., if I had
actually tried to connect I wouldn't have been able to, because Network
Prefs would first have to be changed to the local 10.1.2 network settings to
be able to find the G3.) I find that pretty amazing. When I clicked "Cancel"
in the "Connect to" dialog, THEN the script's own error trap came into play,
and I _was_ asked to find another file to set as a property. The "Cancel"
was, of course, seen as error number -128, so the error trap went ahead.
I'm really very impressed with OS X's behavior here. It means that all sorts
of scripted interconnectivity must be possible. (Back on-topic, sort of.)
Digression over.
--
Paul Berkowitz
_______________________________________________
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.