Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global interval
  2.  
  3. tell application "GrowlHelperApp"
  4.  -- Make a list of all the notification types
  5.  -- that this script will ever send:
  6.  set the allNotificationsList to ¬
  7.   {"Сядь ровно" }
  8.  
  9.  -- Make a list of the notifications
  10.  -- that will be enabled by default.      
  11.  -- Those not enabled by default can be enabled later
  12.  -- in the 'Applications' tab of the growl prefpane.
  13.  set the enabledNotificationsList to ¬
  14.   {"Сядь ровно"}
  15.  
  16.  -- Register our script with growl.
  17.  -- You can optionally (as here) set a default icon
  18.  -- for this script's notifications.
  19.  register as application "Сядь ровно" ¬
  20.    all notifications allNotificationsList ¬
  21.    default notifications enabledNotificationsList ¬
  22.  
  23. end tell
  24.  
  25. set thePrefix to ""
  26. set interval to "5"
  27. set theIcon to note
  28.  
  29. repeat
  30.    display dialog thePrefix & "Введите период оповещения в минутах:" default answer interval with icon theIcon
  31.    set interval to text returned of result
  32.    try
  33.       if interval = "" then error
  34.       set interval to interval as number
  35.       exit repeat
  36.    on error
  37.       set thePrefix to "Пожалуйста, "
  38.       set theIcon to stop
  39.    end try
  40. end repeat
  41.  
  42.  
  43. on idle
  44.     tell application "GrowlHelperApp"
  45.  
  46.         notify with name "Сядь ровно" ¬
  47.           title "" ¬
  48.           description "Сядь ровно" ¬
  49.           application name "Сядь ровно" ¬
  50.  
  51.     end tell
  52.     return interval * 60
  53. end idle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement