Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Selektierte Dateien im Papierkorb wiederherstellen
- on GUIScripting_status()
- -- check to see if assistive devices is enabled
- tell application "System Events"
- set UI_enabled to UI elements enabled
- end tell
- if UI_enabled is false then
- tell application "System Preferences"
- activate
- set current pane to pane id "com.apple.preference.universalaccess"
- 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
- end tell
- end if
- end GUIScripting_status
- tell application "Finder"
- open trash
- activate trash
- -- select files in trash
- set filesInTrash to the selection
- repeat with TrashedFile in filesInTrash
- select TrashedFile
- tell application "System Events"
- key code 51 using command down
- end tell
- delay 1
- end repeat
- close every window
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement