Hello everyone. I had a need to move all the items that were in a folder up one level. Like moving ‘file’ from ‘Subfolder’ to ‘Folder with subfolders’:
Folder with subfolders-
Subfolder-
file
You know… this seems like something simple… but I tried for hours and nothing seemed to work (that’s early am programming for you).
I tried:
set containing_folder to (choose folder)
set enclosed_folder to folder of containing_folder whose name contains "blueberry"
tell application "Finder"
move all items of enclosed_folder to containing_folder
end tell
I got an error.
I tried ‘do shell script’ alternatives but I could not ‘cd’ to the containing_folder. I could ‘ls’ the containing_folder but not cd to it to do a mv * … command.
The “Applescript” book by Rosenthal less that useless on this point and I scoured this forum to no result.
Finally I used a script that traveled all containing folders and moved all flies to the enclosing folder but it seems like a lot of firepower just for something as simple as “mv * …/”
So how do you get an instance of a folder, and its contents, if you don’t know the folders name before hand?
As always, thanks to all of you here who make scripting fun and an education… and make this forum THE resource for those of us who don’t know what the hell we are doing!