- fix IE6 bugs in (pick any project)
- program in AppleScript
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
No comments:
Post a Comment