Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automatically remove "._" files from Windows shares' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically remove "._" files from Windows shares
Authored by: bigkm on Jun 27, '06 08:06:59AM
or you could just drop your share onto this applescript droplet instead of ejecting it.

on run
	display dialog "Drag a removable disk icon here to have it cleaned and ejected"
end run

on open selectedItem
	-- get a text version of the volume name and remove the trailing colon :
	set volumeName to selectedItem as string
	set volumeName to characters 1 thru (the (length of volumeName) - 1) of volumeName as string
	if (list disks) contains volumeName then
		do shell script "find '/Volumes/" & volumeName & "' -name '.DS_Store' -exec rm '{}' \\;"
		do shell script "find '/Volumes/" & volumeName & "' -name '._*' -exec rm '{}' \\;"
		try
			do shell script "rm -rd '/Volumes/" & volumeName & "/.Trashes'"
			do shell script "rm -rd '/Volumes/" & volumeName & "/.TemporaryItems'"
		end try
		try
			tell application "Finder" to eject disk volumeName
		end try
	end if
end open



[ Reply to This | # ]