Page 1 of 1

Is it possible to display the Date & Time with Launchbar

Posted: Tue Jan 09, 2007 3:21 am
by kmnjunk2007
I'm wondering if it's possible to show the date and time in large bezel with Launchbar, or even by growl via launchbar

Posted: Tue Jan 09, 2007 4:03 pm
by eth0
It's possible, using an AppleScript like this:

Code: Select all

set theDate to the current date
set theTime to the time string of theDate
set theDate to the date string of theDate

set theTime to urlEncodedString(theTime)
set theDate to urlEncodedString(theDate)

open location "x-launchbar:large-type?title=" & theDate & "&string=" & theTime

on urlEncodedString(s)
   set oldDelimiters to AppleScript's text item delimiters
   
   set AppleScript's text item delimiters to "+"
   set listOfLines to every text item of s
   set AppleScript's text item delimiters to "%2b"
   set s to listOfLines as string
   
   set AppleScript's text item delimiters to " "
   set listOfLines to every text item of s
   set AppleScript's text item delimiters to "+"
   set s to listOfLines as string
   
   set AppleScript's text item delimiters to "&"
   set listOfLines to every text item of s
   set AppleScript's text item delimiters to "&"
   set s to listOfLines as string
   
   set AppleScript's text item delimiters to oldDelimiters
   return s
end urlEncodedString

Posted: Tue Jan 09, 2007 6:22 pm
by macsterdam
amazing - thanks a lot!