dominus

dom

Mar 1st, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. tell application "Mail"
  2. activate
  3. set snapshotdialog to display dialog "Neue Revision von xU4. Snapshot erstellen?" buttons {"Cancel", "OK"} giving up after 180 with icon caution with title "xU4 Snapshot"
  4. if button returned of snapshotdialog = "OK" then
  5. activate application "Terminal"
  6. tell application "System Events" to tell process "Terminal"
  7. keystroke "t" using {command down}
  8. end tell
  9. tell application "Terminal"
  10. repeat with win in windows
  11. try
  12. if get frontmost of win is true then
  13. do script "cd ~/code/sh; . xu4snapshot.sh" in (selected tab of win)
  14. end if
  15. end try
  16. end repeat
  17. end tell
  18. else if gave up of snapshotdialog is true then
  19. activate application "Terminal"
  20. tell application "System Events" to tell process "Terminal"
  21. keystroke "t" using {command down}
  22. end tell
  23. tell application "Terminal"
  24. repeat with win in windows
  25. try
  26. if get frontmost of win is true then
  27. do script "cd ~/code/sh; . xu4snapshot.sh" in (selected tab of win)
  28. end if
  29. end try
  30. end repeat
  31. end tell
  32. end if
  33. end tell
Add Comment
Please, Sign In to add comment