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


Click here to return to the 'An AppleScript to create a size-limited trash can' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to create a size-limited trash can
Authored by: aqsalter on Nov 11, '06 11:09:44PM
small problem... where it says

	-- Delete the file and update the Trash icon
	set sh_script to "rm -Rf " & quoted form of (POSIX path of oldest_file)
	do shell script sh_script
this will fail with no warning if you don't have permission to delete the file... it should read

	-- Delete the file and update the Trash icon
	set sh_script to "rm -Rf " & quoted form of (POSIX path of oldest_file)
	try
		do shell script sh_script
	on error
		display dialog "Permission denied on file " ¬
			& quoted form of (POSIX path of oldest_file) ¬
			& " would you like to try with administrator priviledges?"
		do shell script sh_script with administrator privileges
	end try


[ Reply to This | # ]