Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

VideoBeagle

macrumors 6502a
Original poster
Aug 17, 2010
823
18
App Q&A testing by request.
I have a drive with a lot of mp3's in folders.

It's littered with the resource forks.

The programs I once used to clean folders no longer work in mavericks, because of course they don't.

Googling for answers has failed....so I decided to try doing some scripting and/or automating.

This script works for individual folders

Code:
set srcFolder to choose folder
set file_path to srcFolder as alias as string
set pfile_path to POSIX path of file_path
tell application "Terminal"
	activate
	delay 1
	do script "cd \"" & pfile_path & "\""
	delay 1
	do script "ls -a> test.txt" in window 1
	do script "rm ._*" in window 1
	do script "ls -a> test2.txt" in window 1
	delay 1
	quit "Terminal"
end tell

but I've failed in figuring out how to get Applescript to travel through subfolders.

In Automator I actually have a Zap Resource Fork action....which seems to no longer work, and while it can traverse subfolders, getting it to execute the script in a useful way isn't really going my way either.

So, I guess the question I have before I invest more time in this...is there a better way to do this?
 
you could also use the find command action for this as well

Code:
find  . -name "_*" rm {} \;

That's in the shell script part? The bigger question, I think is navigating through the file strucutre.

(I think I could cobble together a shell or perl script that does that pretty easily...it's the applescript or automator ways so I'd have an easy app that I think I stumble on)
 
That's in the shell script part? The bigger question, I think is navigating through the file strucutre.

(I think I could cobble together a shell or perl script that does that pretty easily...it's the applescript or automator ways so I'd have an easy app that I think I stumble on)

Yes, that's in the shell script part and it automatically goes down the folder hierarchy from the current or provided folder.

Not sure you need applescript after that as this does it all in one command or shell script (which you could give a memorable name to).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.