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 12:08:40 -0500
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?
I have three words for you:
tell block abuse
Try this instead:
-- begin script
tell application "Finder" to set lockedFiles to every item of f whose locked
is true
if the length of lockedFiles is greater than 0 then
set pathList to ""
repeat with l in lockedFiles
set pathList to pathList & (" '" & l & "'")
end repeat
tell application "MPW Shell"
activate
DoScript "SetFile -a l" & pathList
end tell
end if
-- end script
JR