Skip to content

Instantly share code, notes, and snippets.

@simongcc
Created May 2, 2019 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simongcc/1832191985420d28953fde0a4dc12b59 to your computer and use it in GitHub Desktop.
Save simongcc/1832191985420d28953fde0a4dc12b59 to your computer and use it in GitHub Desktop.
Apple script for auto put back files
# original: https://discussions.apple.com/thread/7831626
# keyboard keycodes: https://eastmanreference.com/complete-list-of-applescript-key-codes
tell application "System Events"
tell process "Finder"
repeat 100 times
tell application "Finder" to open trash
tell application "Finder" to activate
key code 126
key down command
key code 51
key up command
delay 0.4
end repeat
end tell
end tell
tell application "Finder" to close every window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment