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


Click here to return to the 'Permanently delete files via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Permanently delete files via AppleScript
Authored by: ryandesign on Feb 23, '08 04:04:01PM

This script is dangerous because it does not properly quote special characters in the names of the to be deleted items. In particular it will not work correctly, and could potentially cause unwanted data loss, when used on items whose names contain the quotation mark. To correct this, replace

do shell script "rm -rf \"" & posixPath & "\""

with

do shell script "rm -rf " & quoted form of posixPath

and

do shell script "rm -rf ~/.Trash/\"" & selectedName & "\""

with

do shell script "rm -rf ~/.Trash/" & quoted form of selectedName



[ Reply to This | # ]