I'm attempting to move a folder to a package folder (a folder with an extension of .tblk).
Code:
tell application "Finder"
set theFolder to (choose folder with prompt "Choose source folder" default location (path to downloads folder))
set theResources to make new folder at theFolder with properties {name:"Resources"}
set theContents to make new folder at theFolder with properties {name:"Contents"}
move theResources to theContents
set thePackage to make new folder at theFolder with properties {name:"package.tblk"}
move theContents to thePackage -- error here
set theConfigurations to (choose folder with prompt "Choose destination folder" default location (path to desktop folder))
move thePackage to theConfigurations
end tell
Error:
Finder got an error: Can’t make document file "Package.tblk" of folder "Desktop" of folder "craibuc" of folder "Users" of startup disk into type folder.
If this line:
set thePackage to make new folder at theFolder with properties {name:"package.tblk"}
is changed to:
set thePackage to make new folder at theFolder with properties {name:"package"}
then the script works as expected.
Is there a better way to work with these types of folders?