Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dot files



Here's a script that will remove .DS_Store files from the entire contents of any folder (tested under OS 10.3.9):

set theFldr to (choose folder)
tell application "Finder" to quit
delay 1
do shell script "defaults write com.apple.Finder AppleShowAllFiles '1'"
tell application "Finder"
activate
delay 1
set newList to (files of entire contents of theFldr whose name is ".DS_Store") as alias list
beep
repeat with aFile in newList
my rmFile(aFile)
end repeat
end tell
tell application "Finder" to quit
delay 1
do shell script "defaults write com.apple.Finder AppleShowAllFiles '0'"
tell application "Finder" to activate


on rmFile(aFile)
	do shell script "rm  " & quoted form of (POSIX path of aFile)
end rmFile

On Jun 18, 2006, at 10:25:19 +0100, Ruth Bygrave <email@hidden>@lists.apple.com wrote:
Date: Sun, 18 Jun 2006 10:25:19 +0100
From: Ruth Bygrave <email@hidden>
Subject: Dot files
To: AppleScript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Why do I get unwanted dot files (.DS Store and _DS Store)? on my
flash drive? Sometimes there are also ghost files (hidden files of 1k
with the same name as an actual file) which stop the flash drive
working properly.

I have a vague idea these are to do with Spotlight indexing or
something, and keep trying to get Spotlight not to index the flash
drive without success--so far I tried selecting the flash drive's
icon from the Add function of the Spotlight Prefs/Privacy pane, which
didn't work, and then trying to drag the icon of the flash drive to
the Spotlight Prefs/Privacy pane (which also didn't work), and trying
to drag the flash drive's icon from the Sidebar (which merely deleted
it while having no effect whatsoever on Spotlight).

I never use the flash drive for anything that needs Spotlight
indexing. In general, it's used for moving files to the XP box (which
has the DVD burner), and there's no point in using either Trash or
Spotlight indexing.

Is there any way I can force the Applescript commands I use for file
copying (backup from Smile, or just the Finder) to avoid creating
junk files? Also, is there a good way to avoid using the Trash with
flash drives, either by using scripts or by setting it up in some way?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.