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


Click here to return to the '10.4: Disable Spotlight on a FAT32 external drive' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Disable Spotlight on a FAT32 external drive
Authored by: blinde on Jul 31, '10 11:21:24AM
i have an applescript that moves my external drives up and to the left of my main drives. while it's doing that, it creates to 'don't index this drive' file automatically.
tell application "Finder"
	set x_offset to -146
	set y_offset to 44
	set i to 1
	try
		set {currX, currY} to desktop position of startup disk
		set sortedFiles to (selection as list)
		sort sortedFiles by creation date
		repeat until i > (count of sortedFiles)
			set thisItem to item i of (selection as list)
			set desktop position of thisItem to {currX + x_offset, currY + y_offset}
			set y_offset to y_offset + 44
			set i to i + 1
		end repeat
		tell application "Finder"
			activate
			ignoring application responses
				tell application "Finder" to set selection to {}
			end ignoring
		end tell
	end try
end tell


tell application "Finder"
	try
		set {currX, currY} to desktop position of startup disk
		set desktop position of disk "lizard_bax_1" to {currX + -73, currY + 2}
		try
			make new file at disk "lizard_bax_1" with properties {name:".metadata_never_index"}
		on error -- couldn't make spotlight prevention file on lizard_bax_1
		end try
		try
			set desktop position of disk "sparrow_bax_1" to {currX + -73, currY + 46}
			make new file at disk "sparrow_bax_1" with properties {name:".metadata_never_index"}
		on error -- couldn't make spotlight prevention file on sparrow_bax_1
		end try
		set desktop position of disk "misc_bax_1" to {currX + -73, currY + 92}
		set desktop position of disk "_stuff" to {currX + -146, currY + 2}
		set desktop position of folder "desktop_misc" to {currX, currY + 92}
	end try
	try
		set {currX, currY} to desktop position of startup disk
		set desktop position of disk "lizard_bax_2" to {currX + -73, currY + 2}
		try
			make new file at disk "lizard_bax_2" with properties {name:".metadata_never_index"}
		on error -- couldn't make spotlight prevention file on lizard_bax_2
		end try
		set desktop position of disk "sparrow_bax_2" to {currX + -73, currY + 46}
		try
			make new file at disk "sparrow_bax_2" with properties {name:".metadata_never_index"}
		on error -- couldn't make spotlight prevention file on sparrow_bax_2
		end try
		set desktop position of disk "misc_bax_2" to {currX + -73, currY + 92}
		set desktop position of disk "_stuff" to {currX + -146, currY + 2}
		set desktop position of folder "desktop_misc" to {currX, currY + 92}
	end try
	activate
end tell


[ Reply to This | # ]