Dear Guys,
I’ve tryed to do versions of the same but with little succes.
The challenge is this.
I’ve downloaded old radio shows from streamcast and now they are in a million folders… each item is embeded in its own folder inside many, many other folders. What I am trying to get is all items of type .mp3 to the root folder of this mess.
Here is what I’ve tryed but I can’t get it to recurse and obviously test is not really the way to do things.
set containing_folder to (choose folder)
tell application "Finder"
if folder "test" of containing_folder exists then
set enclosed_folder to folder "test" of containing_folder as alias
tell application "Finder" to move folder enclosed_folder's items to containing_folder
else
display dialog "we have an error: there are no matching folders in side the folder"
end if
end tell
Seems simple… and perhaps it is… but its stumping me.
HNY!!!
Not sure if I get what you are trying to do - but does this help?
tell application "Finder"
set x to every file of (every folder whose name is "test") of (choose folder)
--then do your move here with a repeat loop perhaps....
end tell
This should work:
choose folder
get quoted form of POSIX path of result
try
do shell script "cd " & result & "; /usr/bin/find . -iname '*.mp3' -exec /bin/mv -n {} . \\;"
on error errorMsg number errorNum
display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
end try
If a file would have the same name as an existing file, it will not be moved.
Man!!!
Did that work a charm!
That is EXACTLY what I was looking for and so easy. (just for the record I wanted to move .mp3 files so a quick change from .aiff to .mp3 did the trick).
Bruce, this is so fast and efficient. Thanks for your help. MacScripter to the rescue again!

Heh. it’s easy for me to make dummy AIFF files, so that’s what I tested it with. I just forgot to change it to mp3 when I posted it.