Advertisement
Guest User

Dateien aus Papierkorb wiederholen neu

a guest
Mar 5th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Selektierte Dateien im Papierkorb wiederherstellen
  2.  
  3. on GUIScripting_status()
  4.     -- check to see if assistive devices is enabled
  5.     tell application "System Events"
  6.         set UI_enabled to UI elements enabled
  7.     end tell
  8.     if UI_enabled is false then
  9.         tell application "System Preferences"
  10.             activate
  11.             set current pane to pane id "com.apple.preference.universalaccess"
  12.             display dialog "This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS x which is currently disabled." & return & return & "You can activate GUI Scripting by selecting the checkbox \"Enable access for assistive devices\" in the Universal Access preference pane." with icon 1 buttons {"Cancel"} default button 1
  13.         end tell
  14.     end if
  15. end GUIScripting_status
  16.  
  17. tell application "Finder"
  18.     with timeout of 1.0E+9 seconds
  19.         open trash
  20.         activate trash
  21.         -- select files in trash
  22.         set filesInTrash to the selection
  23.         repeat with TrashedFile in filesInTrash
  24.             select TrashedFile
  25.             tell application "System Events"
  26.                 key code 51 using command down
  27.             end tell
  28.             delay 0.2
  29.         end repeat
  30.     end timeout
  31.     -- close every window
  32. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement