Move most recent 5 folders

I am useless at AppleSCript / Automator, so Newbie apologises first ...

I am trying to move the 5 most recently created folders and their full contents from one folder to another.
He's what I have so far and I get the error 'Finder got an error: AppleEvent handler failed.'

tell application "Finder"

set sourceFolder to "/Users/admin/Desktop/TEST/IN"
get contents of sourceFolder
set targetFolder to "/Users/admin/Desktop/TEST/OUT"

move every item of sourceFolder to targetFolder

end tell




The Finder doesn't know about POSIX paths, so you will need to use HFS paths, aliases, or coerce to the POSIX file class.  A better approach might be to use System Events, which can handle POSIX paths.
Move most recent 5 folders
 
 
Q