So here is probably a dumb question.All I want to do is move all my files from one folder to another. I found this applescript that is setup to choose a source folder, a destination folder, and then it moves all items to the new folder. I already know what my source and destination folders are, so I’m trying to bypass the user prompt. It doesn’t seem to be working quite right. I’m sure it’s something simple, just don’t know what. I posted the original, my applescript, and the error below. Thanks guys:
Original:
tell application "Finder"
set Destination to (choose folder with prompt "Pick the destination Folder...")
set Source to (choose folder with prompt "Pick the source Folder...")
set theList to every file in folder Source
repeat with thisFile in theList
set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "."}
set folderName to (text items 1 thru -2 of (get name of thisFile)) as text
set AppleScript's text item delimiters to tid
set newFolder to make new folder at Destination with properties {name:folderName}
move thisFile to newFolder
end repeat
end tell
My Script:
tell application “Finder”
set Destination to ((path to movies folder as text) & “myFolder2”)
set Source to ((path to desktop folder as text) & “myFolder1”)
set theList to every file in folder Source
repeat with thisFile in theList
set {tid, AppleScript’s text item delimiters} to {AppleScript’s text item delimiters, “.”}
set folderName to (text items 1 thru -2 of (get name of thisFile)) as text
set AppleScript’s text item delimiters to tid
set newFolder to make new folder at Destination with properties {name:folderName}
move thisFile to newFolder
end repeat
end tell
Error:
Finder got an error: Can’t make class folder.