I’ve wrote this little script to find files based on their extension.
If so, I am doing two things:
- move them to a specific folder;
- assign a color based on the extension
The script does not work for assigning a color I get the following error message : Can’t set “class labi” of {} to 3.
Would anyone have an idea why this script is not working?
With regards!
Daniel
my VerifyConvertedFiles((path to home folder as text) & "FPAQ:WVCUfiles:", "mp4", 3)
my VerifyConvertedFiles((path to home folder as text) & "FPAQ:WVCUfiles:", "avi", 4)
on VerifyConvertedFiles(WVCUDestinationFolder, theFORMAT, ColorNumber)
tell application "Finder"
set theCardFiles to files in folder WVCUDestinationFolder whose name extension is theFORMAT
set theFile to files in folder WVCUDestinationFolder whose name extension is theFORMAT
tell application "Finder" to set label index of theFile to ColorNumber
end tell
if (count of theCardFiles) is equal to 0 then
display dialog "No " & theFORMAT & " have been found"
return
end if
display dialog theFORMAT & " have been found"
my MoveConvertedFiles(theFORMAT)
end VerifyConvertedFiles