Hi,
Sorry in advance for these dumb questions
- I want to set the file type and creator for 4 files to certain values. So I wrote this handler:
on set_file_type_and_creator(thefile, thetype, thecreator)
tell application āFinderā
set file type of file thefile to thetype
set creator type of file thefile to thecreator
end tell
end set_file_type_and_creator
which I invoke like this:
set_file_type_and_creator(file1, file_type, file_creator)
set_file_type_and_creator(file2, file_type, file_creator)
set_file_type_and_creator(file3, file_type, file_creator)
set_file_type_and_creator(file4, file_type, file_creator)
and it works just fine. But then I thought Iād get clever, and write a handler that would process a list. That way, it would be more flexible and Iād only have to call it once. So I changed it to this:
on set_file_type_and_creator_list(thefilelist, thetype, thecreator)
repeat with thefile in thefilelist
tell application āFinderā
set file type of file thefile to thetype
set creator type of file thefile to thecreator
end tell
end repeat
end set_file_type_and_creator_list
which I invoke like this:
set_file_type_and_creator({file1, file2, file3, file4}, file_type, file_creator)
Unfortunately, this gives me āFinder got an error. A descriptor type mismatch occurred. (-10001)ā. What do I need to change to make this work?
- Later, I need to delete these same 4 temporary files. So I do this:
tell application āFinderā
delete {file file1, file file2, file file3, file file4}
end tell
This works just fine, but each time a file is deleted, I hear an annoying āclickā from the Finder. Is there any way to suppress that sound?
Thanks in advance!