I'm trying to make a script that will move every fourth item in a folder to a destination folder. So far I have:
tell application "Finder"
set originFolder to folder choose folder
set dest1Folder to folder choose folder
set dest2Folder to folder choose folder
set quarter to 1
repeat with i from 1 to count of items in originFolder
if quarter is 1 then
move item i of originFolder to dest1Folder
else
move item i of originFolder to dest2Folder
end if
if quarter is 4 then
set quarter to 0
end if
set quarter to quarter + 1
end repeat
end tell
but this gives me
error "Finder got an error: Expected a reference." number -1727
Why isn't this this working and what will work?