Quantcast
Channel: Objective Development Forums
Viewing all articles
Browse latest Browse all 4524

Re: Timer script: Display delayed messages (without hacks)

$
0
0
I modified ptujec's script for my own purposes. being lazy I display the entire input message including the duration of the delay or the ultimate display time. I don't go over days but this meets my needs and allows input of either a duration or a time including the am or pm designation. No error checking.

easily modified by someone less lazy than me.

on handle_string(linein)

   set duration to last word of linein
   if (duration = "am") or (duration = "pm") then
      set wordsin to count of words of linein
      set hh to word (wordsin - 2) of linein
      set mm to word (wordsin - 1) of linein
      set secs to hh * 3600 + mm * 60
      set rightnow to time of (current date)
      set duration to secs - rightnow
   end if
   tell application "LaunchBar"
      display in large type linein after delay duration with sound "Glass"
      delay
   end tell
   
end handle_string

Viewing all articles
Browse latest Browse all 4524

Trending Articles