Re: Is there any way to simplify this?
Re: Is there any way to simplify this?
- Subject: Re: Is there any way to simplify this?
- From: Cal <email@hidden>
- Date: Sat, 20 Jan 2001 15:55:06 -0500
Michelle Steiner <email@hidden> wrote:
>Well...it depends on whether you want the "choose folder" to pop up
in the Finder's execution layer, instead of in the execution layer
where the script is running. If so, you can put the tell block
around the try block:
Well, it's going to run from an applet, so I don't see any need to call
it within a tell wrapper.
But your solution still has the " set thefilelist to ..." line typed
twice, which is what I was trying to avoid.
Sorry...I considered the tell part separate from the set part. I see
the compound statement as a set command with a tell prefix -- to me,
the tell part steers the set command to its target, but it's
essentially a set command. (To each his/her own.) I read "I had to
type the tell statement twice" as a request to avoid duplicating the
tell portion, not the essence (the set part)...and...that's not what
you wanted.
>As an aside, Michelle, this seems a little off to me, making the
assumption that *any* error you would get would require the user to
>choose a folder.
The only recoverable error is if the target folder is not defined; the
purpose of doing it this was is so I don't have to hard-code the target
folder's location into the script. Once the folder is chosen, I had it
stored in a property, but with Paul's suggestion, it's now stored an
implied global variable.
I too like Paul's approach.
Frankly, I can't see anything else that would return an error other than
the folder being undefined, and that should happen only the first time
the script is run.
Other File Manager errors could be returned, such as I/O errors.
Take a look at errors -34 through -49 (or -49 through -34, depending
on your polarity), particularly -36 (I/O error).
Cal