Re: What does "Finder could not get folder..." mean? (tell block abuse)
Re: What does "Finder could not get folder..." mean? (tell block abuse)
- Subject: Re: What does "Finder could not get folder..." mean? (tell block abuse)
- From: JollyRoger <email@hidden>
- Date: Wed, 01 Aug 2001 18:12:12 -0500
On 8/1/2001 1:44 PM, "Chris Page" <email@hidden> wrote:
>
nigh on 8/1/01 10:08 AM, JollyRoger at email@hidden wrote:
>
>
> On 8/1/2001 8:06 AM, "Chris Page" <email@hidden> wrote:
>
>
>
>>> set pathList to pathList & (" '" & l & "'")
>
>> ^^^
>
>> It happens here. This sends a "get" event to the Finder, which returns the
>
>> error.
>
>
>
> The question is: Why are you telling the Finder to set pathList to pathList
>
> & (" '" & l & "'")? There are zero Finder commands in that line. You are
>
> causing the error by getting the Finder involved in something in which it
>
> has no business being involved. As a matter of fact, there are many lines
>
> in the script that have zero Finder commands in them; yet they are all
>
> enclosed in a Finder tell block. Why?
>
>
Well, like I said, that line sends a "get" to the Finder, because there's an
>
implicit "get i as alias"
No, it is sent to the Finder because you enclosed the command in a Finder
tell block - no other reason. Remove the tell application "Finder" from the
command and the Finder will stop trying to interpret the command.
>
(in fact, I tried doing it explicitly and the problem seemed to go away for a
>
bit, but then it came back).
It's not magic. You must have changed something to make it break again.
I'd need more specifics to tell you what you did wrong.
>
Maybe that doesn't require a tell block,
Not maybe - definitely. None of the commands in that line are Finder
commands - and that goes for all but one line of the entire script.
>
but anyway I don't think the use of a tell block is the problem. Are you
>
saying that it *is* the problem or you just think it *could* be the problem?
The Finder is generating an error because it is trying to make sense of the
command. The command isn't a Finder command. If you weren't sending the
command to the Finder in the first place, you wouldn't be having this
problem.
This is what I mean by tell block abuse. The bad habit of enclosing
everything in tell blocks cause this and other subtle problems that are hard
to diagnose. You can save yourself some time and trouble by using better
judgment when choosing to use tell blocks.