Hi everyone
I’m new to apple script and i’ve been trying to write a script that will allow me to move folders from my “downloads folder” to my “movies folder”, “music folder” etc. I’ve been trying to accomplish this by trying to move all folders from the “download folder” that contain, for instance, “avi” and “mp4” file extensions to the “movie folder”.
I’ve written this code to try and do it but its not working, i’m not sure but i think it may have something to do with the if clause
tell application “Finder”
set main_folder to (choose folder with prompt “Choose the main folder”)
set dest_folder to (choose folder with prompt “Choose destination folder”)
set sub_folders to folders of main_folder
set folderfiles to files of sub_folders
repeat with each_folder in sub_folders
if (each_folder contains folderfiles whose name extension is in {“avi”, “jpg”}) then move sub_folders to dest_folder with replacing
end repeat
end tell
If anyone has any ideas on this script or perhaps another way that i could easily do the same thing i would be very grateful
Thanks