Re: Error-trapping alias properties
Re: Error-trapping alias properties
- Subject: Re: Error-trapping alias properties
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 29 Mar 2002 07:14:06 -0800
On 3/29/02 3:56 AM, "Kai Edwards" <email@hidden> wrote:
>
if theFile is not "" then
>
check(theFile) -- do any required text-based checks and continue
>
try
>
get theFile as alias -- or whatever
>
on error
>
set origFile to choose file -- or whatever
>
end try
Thanks for trying Kai. But won't that bit of code make you 'choose file' all
over again any time you move the file from one folder to another? I can get
that by simply storing the string file path, and is precisely what I'm
trying to avoid.
Your method still sets origFile to an alias (the result of 'choose file'),
and that's what you're storing in the property. So it does not avoid the
head-on confrontation: the script will never get to your error test when it
hits 'property : origFile' right at the op of the script, on a different
computer.
The reason why you're avoiding it when you trash the file must be the same
as what Emmanuel and Paul Skinner found: the script somehow "imagines" a
hard disk whose name is a conflation of the saved startup disk plus root
folder and doesn't error it. Peculiar and faulty as this is, it would
actually be good enough to get all our error tests past that first barred
door, if it were consistent. But it doesn't work, in my experience on both
OS 9 and X, if you move the script to another computer.
As soon as I can make the time, I'll play around with these things and see
if there's some way to fool the system past the first line. Thanks to those
who tested with trashed files. I'm still wondering why those false startup
disks with conflated names make it past the front door of the alias
property.
--
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.