Saturday, April 11, 2020

Put Back Multiple Files in MacOS


Recently, I’ve faced the problem that you can’t put back multiple files at once from Trash in MacOS.

The problem is that MacOS can’t restore 2 (or more) files from different directories. WTF?

At first, I was very frustrated because I had ~2000 files in there. Started looking out for a proper solutions & found script, which automates restoring process.

Script often failed, so I tweaked it & here is my version. I hope it could help you ;)




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.2 -- adjust delay as needed
end repeat
end tell
end tell
tell application "Finder" to close every window
view raw restore hosted with ❤ by GitHub

No comments:

Post a Comment