Why won't this work?

OK… it seems like this should be easy but… I keep getting a “Finder got an error: Can’t get every file of alias” message when I try this.

set some_folder to choose folder

tell application “Finder” to move every file of some_folder to folder “purple files” whose label index = 5

Works fine for me under 10.3.8 - try
set some_folder to {choose folder}

Your kidding… It doesn’t work using {} or not… I’ve also got 10.3.8.

I’ve tried 10 different ways to move these files based on their label index (no luck so far) and this is the most concise but I can’t get it to work.

Thanks

I tell a lie, I didn’t spot the second line (doh!!) Try this

property Moved_files : alias “path:to:folder:to_copy_to”
set some_folder to choose folder

tell application “Finder” to move (every file of some_folder whose label index is equal to 5) to folder Moved_files

OOh… I like that.

One issue, if I can press my luck… is that this will be part of a recursive script and that “purple folder” needs to be inside the folder in which the purple files (label Index = 5) are found.

Thanks!@!!

Thanks mindtpl

I got this to work using the following:

set some_folder to (choose folder) as alias
set current_folder to some_folder as string
set purple_folder to current_folder & “purple files:”

tell application “Finder” to move (every file of some_folder whose label index is equal to 5) to folder purple_folder

I hate having to worry about references to files, folder, aliases and all that.

Thanks again… hope I can return the favor.