Re: Selecting a file by creator
Re: Selecting a file by creator
- Subject: Re: Selecting a file by creator
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 25 Apr 2001 13:08:20 -0700
On 4/25/01 9:15 AM, "Pier Kuipers" <email@hidden> wrote:
>
The problem is that you're telling the finder to use a folder which
>
has been set by a "tell" statement to another application. In other
>
words, your tell statements are in the wrong place. The only
>
application that needs to be told anything is the Finder, but it
>
needs to know more than the name of the folder to place the Searches
>
in - it also needs to know where to get the files from. In other
>
words:
>
>
tell application "Finder"
>
set theStartFolder to (choose folder with prompt "Move from here...")
>
set theChosenFolder to (choose folder with prompt "To here...")
>
select (every file of theStartFolder whose creator type is "CSOm")
>
move selection to theChosenFolder
>
end tell
>
>
ope this helps!
Actually, none of that except the moving needs to be in the Finder (choose
folder is an osax from Standard Additions) and you certainly don't need any
selecting going on. That's just going to slow everything down and get in the
way, and also create problems if, as seemed to be in the original script,
there's in fact another app in the front. Defining the files by creator type
within the Finder block will still allow you to use its useful 'whose'
clause.
set theStartFolder to (choose folder with prompt "Move from here...")
set theChosenFolder to (choose folder with prompt "To here...")
tell application "Finder" to move (every file of theStartFolder whose
creator type is "CSOm") to theChosenFolder -- one line
--
Paul Berkowitz