Skip to content

Instantly share code, notes, and snippets.

@faresd
Created May 28, 2013 08:14
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save faresd/5661253 to your computer and use it in GitHub Desktop.
Save faresd/5661253 to your computer and use it in GitHub Desktop.
AppleScript restore multiple files from trash Mac os
try
delay 15 -- adjust delay as needed
repeat 40000 times
try
tell application "Finder" to close every window
delay 0.09 -- adjust delay as needed
set theDigit to func(37)
on error
do shell script "killall Finder"
delay 10 -- adjust delay as needed
set theDigit to func(37)
end try
end repeat
on error
do shell script "killall Finder"
repeat 40000 times
delay 20 -- adjust delay as needed
set theDigit to func(37)
end repeat
end try
to func(bla)
tell application "Finder" to close every window
repeat 100 times
tell application "AppleScript Utility"
set GUI Scripting enabled to true
end tell
tell application "Finder"
open trash
activate trash
tell application "System Events"
key code 125
key code 51 using command down
end tell
end tell
delay 0.1 -- adjust delay as needed
end repeat
tell application "Finder" to close every window
delay 0.099 -- adjust delay as needed
end func
@faresd
Copy link
Author

faresd commented May 28, 2013

'Put Back' multiple items in Trash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment