Is it possible to display the Date & Time with Launchbar

General discussions about LaunchBar
Post Reply
kmnjunk2007

Is it possible to display the Date & Time with Launchbar

Post by kmnjunk2007 » Tue Jan 09, 2007 3:21 am

I'm wondering if it's possible to show the date and time in large bezel with Launchbar, or even by growl via launchbar

eth0

Post by eth0 » Tue Jan 09, 2007 4:03 pm

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

macsterdam
Rank 2
Rank 2
Posts: 41
Joined: Thu Nov 16, 2006 5:22 pm

Post by macsterdam » Tue Jan 09, 2007 6:22 pm

amazing - thanks a lot!

Post Reply