Re: A moveFile and Finder object references question
Re: A moveFile and Finder object references question
- Subject: Re: A moveFile and Finder object references question
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 26 Jan 2001 12:40:06 -0500
- Organization: [very little]
cuttlefish wrote:
>
Date: Fri, 26 Jan 2001 11:32:19 -0500
>
To: email@hidden
>
From: email@hidden
>
Subject: A moveFile and Finder object references question
>
>
Hi,
>
>
I have a script which moves files based on their label from my
>
downloads folder to appropriate folders on my drive, for example:
>
>
try
>
move (every file of folder "Downloads" of disk "Trillian" whose label
>
index = "7") to folder "Papers" of folder "work" of disk "Trillian"
>
on error
>
beep
>
end try
>
>
I would like to try to use Jons Commands "moveFile" command to do
>
this (its apparently quicker), however the readme says "You cannot
>
use Finder object references with these commands. You need to coerce
>
them to strings or aliases in order to pass them to these commands"
>
which Im guessing means I cannot use:
>
>
(every file of folder "Downloads" of disk "Trillian" whose label index = "7")
>
>
in the script.
>
>
So my question is how would I make "(every file of folder "Downloads"
>
of disk "Trillian" whose label index = "7")" into a list of strings
>
or alias's which moveFile can work on?
You need to set a variable to (every file of folder "Downloads" of disk
"Trillian" whose label index = "7"). This variable will reference a
list of Finder references. Then:
set aliasList to {}
repeat with aFile in fileList -- the variable
set theFile to (contents of aFile)
set aliasList to aliasList & (theFile as alias)
end repeat
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/26/01 12:39:42 PM]