The script below works without resetting the Finder warning, just as long as I’m emptying things from my User folder. But if I empty anything from my invisible Library folder, the Finder warning gets reset, and next time I empty anything from my Desktop, there is no popup warning. Just wondering why, and if there’s a fix.
tell application "Finder"
tell trash
set warningState to warns before emptying
set warns before emptying to false
empty
set warns before emptying to warningState
end tell
end tell
The below script is only very slightly different, but it seems to work on Library items without resetting the warning state.
tell application "Finder"
set originalWarningState to warns before emptying of trash
set warns before emptying of trash to false
empty trash
set warns before emptying of trash to originalWarningState
end tell