image
image

|


Go Back   macosx.com > Scripts > Automator Scripts

Reply
 
Thread Tools
  #1  
Old January 22nd, 2008, 12:14 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,162
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
[AUTOMATOR] Cleaning DS_Store and ._*

I'll break the ice then.

This workflow asks for one or many locations (folders or volumes) on which you would like to remove:
• ._DS_Store
• ._FILENAME

You also, obviously, require necessary permissions to delete the files you're trying to delete.

I wipped this up in 2 minutes to clean the flash media card for my iDEN i880 cell phone, which tries to play every file it sees, which is all of them. I have not extensively tested this scirpt and do not accept any responsibility if it somehow deletes everything on your computer (though, it really shouldn't).

If you regularly use this in the same way I do (for cleaning up a cell phone memory card, for example) you can change the first element to a static folder name, and then add an Eject Volume action at the end, so it all gets done with one click.

I've also included a PDF of the workflow for anyone interested only in looking. It's pretty simple!
Attached Files
File Type: pdf Clean resource forks.pdf (69.7 KB, 20 views)
File Type: zip Clean resource forks.workflow.zip (52.3 KB, 26 views)
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.4.11 (8S165) | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0

Last edited by michaelsanford; January 22nd, 2008 at 12:15 PM. Reason: Corrected something
Reply With Quote
  #2  
Old July 23rd, 2008, 04:06 AM
Registered User
 
Join Date: Jul 2008
Posts: 11
Thanks: 19
Thanked 0 Times in 0 Posts
suntannedboy is on a distinguished road
Hi, I am curious that if you get _desktop.ini under each directory of your hard drive (a USB external hard drive, for instance)? I think I got those files becuase I am connecting to Windows XP and when I share files with Windows, I automatically get those uesless files. And they are kind of cluttering in my system now; do you use the same Automator workflow to eliminate those _desktop.ini files?
Reply With Quote
  #3  
Old July 23rd, 2008, 10:37 AM
A Budding Unix Junkie
 
Join Date: Jul 2008
Location: Pacific Northwest
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
ThomasG33K is on a distinguished road
It would clean those files up with a small modification. Since there is no dot in front of the _FILENAME.ini file you need to change the code...

from

Quote:
find $f -type f -name "._*" -exec rm {} \;
to

Quote:
find $f -type f -name "_*" -exec rm {} \;
For added safety you could also make the line:

Quote:
find $f -type f -name "_*ini" -exec rm {} \;

Last edited by ThomasG33K; July 23rd, 2008 at 10:43 AM. Reason: Trying to get this to make sense.
Reply With Quote
The Following User Says Thank You to ThomasG33K For This Useful Post:
suntannedboy (July 23rd, 2008)
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 08:12 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.