Advertisement
Guest User

Dateien aus Papierkorb wiederholen

a guest
Mar 5th, 2014
187
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.     open trash
  19.     activate trash
  20.     -- select files in trash
  21.     set filesInTrash to the selection
  22.     repeat with TrashedFile in filesInTrash
  23.         select TrashedFile
  24.         tell application "System Events"
  25.             key code 51 using command down
  26.         end tell
  27.         delay 1
  28.     end repeat
  29.     close every window
  30. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement