Advertisement
Guest User

AppleScript to put back all trash files

a guest
Nov 27th, 2012
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script iterates through all files in trash
  2. -- and put them back, because of MacOs don't
  3. -- allow to user this feature with multiple selection
  4. --
  5. -- 2012/Tommy the Blackbird
  6.  
  7. tell application "AppleScript Utility"
  8.     set GUI Scripting enabled to true
  9. end tell
  10.  
  11. tell application "Finder"
  12.     open trash
  13.     activate trash
  14.     select files in trash
  15.     set filesInTrash to the selection
  16.     repeat with TrashedFile in filesInTrash
  17.         select TrashedFile
  18.         tell application "System Events"
  19.             key code 51 using command down
  20.         end tell
  21.         delay 1
  22.     end repeat
  23.     close every window
  24. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement