Wednesday, August 26, 2009

Running the Bespin command line from the, well, the command line

I felt a little masochistic today which left two possibilities open:
  1. fix IE6 bugs in (pick any project)
  2. program in AppleScript
I chose #2.

The following script will execute it's command line arguments as commands inside bespin (if it is running in the current tab of Safari).
on run argv
tell application "Safari"

set docs to every document

set cmd to ""
repeat with c in argv
set cmd to cmd & c & " "
end repeat

set js to "(function () {if(typeof bespin != 'undefined') { return bespin.get('commandLine').executeCommand('" & cmd & "').output.replace(/]*>/g, '\\n').replace(/<[^>]*>/g, '') } else { return '' }})()"

set out to ""

repeat with doc in docs

set output to do JavaScript js in doc

set out to out & "
" & output

end repeat

out

end tell
end run


Wrap this in a little shell script:
#!/bin/bash
cp bespin.scpt bespin.work.scpt
osascript bespin.work.scpt "$@"

(Don't ask about line two (it is part of the masochism experience :))

... and now stuff like this works:
-bash-3.2$ ./bespin set | grep collab
collaborate = off

Thursday, August 13, 2009

Bringing the awesome JSConf to Europe

@janl, @hblank and @me are proud to announce that we will bring JSConf to Europe!

From the announcement:

JSConf in Washington, DC in April this year proved to be the homecoming of a JavaScript community that didn't know it existed. The conference got top marks all around for content, community and fun. With JSConf.eu, we let that spirit live on and give JavaScript a home in Europe. (why let the americans have all the fun? :)

Mark November 7th/8th in your calendar, we'll be presenting top speakers in the field and a relaxing atmosphere in Berlin, Germany's pulsing capital. Join us for a two-day, community-focussed indie conference with top technical content around your favourite language and great opportunities to meet like-minded people.

Our speakers so far include:
Amy Hoy,
Thomas Fuchs,
John Resig,
Dion Almaer &
Ben Galbraith

I'm really looking forward to the event. See you there!

Sunday, August 2, 2009

Joose 2.1 released

We are proud to announce the release of Joose 2.1

This release is a pure maintenance release with minor fixes and enhancements:
  • Fix a rare issue that occurs with Firefox 3.5 native JSON supports when using Joose.Storage
  • Fix an issue with the Google Gears detection code in Joose.Gears when Gears is installed but disabled in Firefox 3.5
  • Various performance enhancements in heavy used methods
  • Joose.Singleton's singletonInitialize methods now receives the parameters which are passed to the first call of getInstance().
If you are not using either Joose.Storage or Joose.Gears there is no immediate need to upgrade.