dot_clean Command?
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Would there be any way to have an AppleScript that would be running in the background and would run the dot_clean command on a thumbdrive right before it is ejected? I'm sick of those .DS_Store and .Spotlight files when I move to a Windows PC.
8 replies
Sign in or join Beachball Help to reply.
- 0
dev_sleidy ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
'dot_clean' removes '._' entries; not '.DS_Store', '.Spotlight-V100', or other '.' files and / or directories.
Sadly, Apples' forums formatting capabilities appears equally crippled as 'Leopard's 'Dock' and 'Finder'; therefore, a possible solution, to your request, is at '
dev-sleidy - AppleScript' (under 'dot_clean Command?'). - 0
matthew5384 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
This script is exactly what i was looking for, but is there a way to make it automatically clean it when the disk is ejected? So that I don't have to drag it onto the applet.
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I believe some of those files like .Spotlight-V100 are owned by root. That means that you should modify some of your shell script commands to run with admin privileges and throw in a dialog to enter the admin password.
Message was edited by: V.K.
- 0
matthew5384 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Ok, that was helpful, but what would it take to make it run automatically when a drive is ejected?
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
no, sorry, but there is absolutely no way to do that. If you want to streamline the process a bit more you can get rid of the first popup in dev's script. Then to eject the drive you simply have to drag and drop it onto applet's icon. Also, to run a shell script with admin privileges inside an apple script you normally use the syntax
----------------
do shell script "blah-blah" with administrator privileges
----------------------
however, this will cause the program to ask you for your admin password. To further streamline the process you can use----------------
do shell script "blah-blah" password "your-admin-password" with administrator privileges
----------------------This will make it run silently but it will also mean that you'd have to enter your admin password in the script in open text. This is clear a security risk and I'm not sure you'd want to do that.
- 0
matthew5384 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Then what is the best way to deal with .DS_Store and .Spotlight files?
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
.DS_store is not owned by root so there is no problem with that. for spotlight files i guess you have to pick your poison and choose between convenience and security.
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
sorry, I take it ALL back. Thumb drives are usually formatted FAT32 in which case you don't need to worry about any problems with admin privileges (unix permissions are set to 777 on everything) . Dev's script will work as is.