Re: Why doesn't this simple script work? (Tell block abuse strikes again)
Re: Why doesn't this simple script work? (Tell block abuse strikes again)
- Subject: Re: Why doesn't this simple script work? (Tell block abuse strikes again)
- From: Jolly Roger <email@hidden>
- Date: Wed, 08 Aug 2001 13:32:50 -0500
On 8/8/2001 11:49 AM, "email@hidden" <email@hidden>
wrote:
>
tell application "Finder"
>
activate
>
set this_folder to "Daily Pairer 1:DailyDone:"
>
set these_items to list folder this_folder without invisibles
>
repeat with i from 1 to the count of these_items
>
set this_item to alias ((this_folder as text) & (item i of
>
these_items as text))
>
set the item_info to info for file (this_item)
>
if folder of the item_info is true then
>
if (alias of the item_info is false) and (the file type of
>
the item_info is "EPSF") then
>
move this_item to folder "Ad Report Folder:"
>
end if
>
end if
>
end repeat
>
end tell
>
>
I get the error
>
>
--> Can't get folder of {name:"IP09.15N.1ST.EPSF", creation date:date
>
"Wednesday, August 8, 2001 3:47:47 pm", modification date:date "Wednesday,
>
August 8, 2001 3:47:49 pm", icon position:{-1, -1}, visible:true,
>
size:5.78659E+5, folder:false, alias:false, locked:false, busy
>
status:false, file creator:"XPR3", file type:"EPSF", short version:"", long
>
version:""}.
*sigh* I feel like a broken record...
This is yet another example of how tell block abuse is a big problem. The
context in which you are trying to use the term "folder" belongs to Standard
Additions. However, since you used the term "folder" in a Finder tell
block, you have effectively caused the Finder to look at the term.
Coincidentally, the Finder dictionary also defines a term "folder". Since
the Finder only considers terms it defines, it is naturally giving you an
error since the usage does not fit the context the Finder expects. Get rid
of the tell block for this line and your problems will fade.
JR