Duncan's Radio-controlled Weblogs : Navig8, Aggreg8, Syndic8, and Radio8
Updated: 2/2/02; 12:32:50 am.

 

Click to see the XML version of this web page.

 
 

Monday, January 28, 2002

Frontier, BBEdit, guest databases, and Radio

Skip to the last few paragraphs to see why I am so chuffed this evening...

In the summer of '99 I extensively reworked the old Frontier bbsite suite and converted it into a guest database - akin to a tool in Radio parlance. Like the old bbsite suite, the new framework used the BBEdit app verbs - see system.verbs.apps.BBEdit.changeNotes for historical interest ;-) - to integrate BBEdit into a workflow not totally unlike that used in Radio today. Since '99 was a time when Frontier guest databases were all the rage I decided that reworking the BBSite suite for GDB deployment would be an excellent way to come up to speed on this new feature of Frontier.

To cut a long story short, the text files of my static websites reside in the filesystem as normal. Associated with each (sub-)site is a .root file that contains all of the site-specific details such as glossaries, images, preferences, etc. For example, my work website is contained in #dunc.root in the top-level directory that contains the files and sub-folders of all my work-related pages. The new guest database version of the bbsite suite - called, unimaginatively, bbsite.root - contains the site independent data, macros, etc.

Until BBEdit 6.5 (or was it 6.1?) came along, pages that I edited in BBEdit could be rendered through the Frontier/gdbbsite combo by invoking the relevant script - normally renderFrontWindow() - using a shared-menu, single keystoke invoked, command. The latest version of BBEdit broke that so I was able to replicate most of the functionality with AppleScripts (or was it UserTalk) in BBEdit's Script folder.

I found this to be a highly productive way to work - edit in BBEdit, render and preview. The render/preview cycle took just a few seconds. Once happy with the rendering the files were FTPed to their final destination. Imagine my disappointment when I found out that Frontier running in Classic mode under Mac OS X crashed and burned Mac IE 5.1 In my changeover to Mac OS X a couple of weeks ago, I had resigned myself to the fact that I might have to reboot into Mac OS 9.2.2 in order to use my beloved Frontier/BBEdit combo. I had even begun to think the unthinkable - abandon this way of working altogether!

So, now that I found myself with a few(!) hours to spare I thought that I might as well investigate the feasibility of using Radio instead of Frontier. I expected that I'd be in for a mammoth debugging session but, hey, nothing ventured nothing gained right?

[Prior to the following steps, BBEdit was open and a text files was open in the frontmost window]:

  1. Duplicated the Radio folder so I could back out of any disaster.
  2. Copied bbsite.root into the RU Tools folder
  3. Launched Radio - which opened up bbsite.root along with the other 'tools'
  4. Made bbsite.root visible and opened the gdbbbsite.renderFrontWindow() script
  5. Manually ran gdbbbsite.renderFrontWindow()
  6. Was totally gob-smacked when the file was rendered properly and previewed in Mac IE 5.1

Eureka! Was I delighted? "You bet your sweet bippy!" I was. It had worked first time. I must have made a better job of the conversion than I thought considering it was now running in a different location to the original file!!

Alas, none of the scripts that used to work in BBEdit 6.5 under Mac OS 9.2.2 worked in Mac OS X. I think they may have originally been UserTalk rather than AppleScript but UserTalk is not (currently) recognised as a valid option in the drop-down 'dialect' menu in the Script Editor window. So, next task was to write an Applescript to do the deed from the BBEdit script menu. Now, I know enough AppleScript to be dangerous but not enough to work out why things go wrong when they do. Or at least I thought I didn't.

My first attempt at the AppleScript was simply:

tell application "Radio UserLand™"
	Do Script "gdbbbsite.renderFrontWindow()"
end tell

This looked promising when it was run from the Script Editor and actually worked. However, when invoked from the BBEdit script menu, BBEdit went deaf and eventually timed out with some sort of appleevent timeout. So, it was not looking good. Then in the dim recesses of my memory I seemed to recall that the call should be wrapped in a thread.easycall. I tried the obvious incantation but of course this didn't work. So if all else fails read 'the source' or RTFM ;-) So a quick jump to thread.easycall in Radio revealed all and would you believe the script:

tell application "Radio UserLand™"
	Do Script "thread.easycall(\"gdbbbsite.renderFrontWindow\",{})"
end tell

actually works!

So, there you have it! BBEdit invoking an AppleScript which in turn invokes a Radio script to render the frontmost window though the new and improved bbsite suite framework. Tomorrow the world!

The original version of this posting is over at http://duncan.smeed.org/2171 so feel free to drop by and ask questions over there. At the moment this is a bit(!?) of a hack and since I based my tool on bbsite, as well as the fact it's hacked to my requirements, it's more useful as a proof of the concept of integrating BBEdit with RU. I'm considering ways of developing this further.
11:56:40 PM    


The whole east coast rail main line is shutdown north of Newcastle tonight. As was the Glasgow to Edinburgh rail service but that seems to have been restored somewhat. And all because of a little wind blowing down tress, overhead power lines, etc!

So, I'm working late in the office tonight as I'm not going home. It's been a while since I did an 'all-nighter'. No doubt I'll crash out and get some sleep at some point - time to procure some soft furnishings from the lab next door ;-).

In the meantime I have made some excellent progress in reconstructing my teaching website framework in Radio. That'll be the topic of the next post...
10:10:32 PM    


Semester 2 starts today. The exams are over (and marked thank goodness!). Luckily, I don't have any lectures today B-}

I'm feeling pretty righteous at the moment. Apart from finishing my exam marking over the weekend, I have broken the back (in numeric terms at least) of the UCAS applications. As Admissions Selector for our five undergraduate degrees I have around 900 applications to deal with over the course of the year. So far about 750 have come in and I've managed to process about 80% of those. The remaining 20% will take 80% of the time because of unusual entry qualifications, overseas applications, etc., etc.

OK, I'm now in the office and hooked up to the Ethernet. E-mail's away. Now to post this stuff and jot down the thoughts I had during my internment on the train. Looks like I also have a few new e-mails to reply to.

BTW, the train finally arrived in Glasgow more than three hours late B-(. Just hoping the return journey works out better.
11:52:50 AM    


One of the greatest delights of Radio is that I can prepare post for my weblog(s) offline. Of course, I could acheive the same thing with the beautifully implemented email-to/from-Conversant features and/or the e-mail-to-Radio hack but there's something simple yet elegant about the way Radio allows me to jot down posts in the browser and then post them for later publication.
11:48:06 AM    

Sigh! I am stuck on the train. The fact that my iBook reports that I only have 41 mins left according to battery level remaining out of a full charge will give you an idea of how long I've been working on the train - 2 hours so far! And the train was 30 minutes late in arriving at the station!!

The trouble this morning is that fact that there are gale force winds Scotland-wide. These winds not only caused the train to be delayed by 30 minutes due to speed restriction but now I'm stuck just outside Edinburgh because a tree has been blown into the overhead electrity lines. The power has been cut completely pending an inspection of the damage and the train is without power. Goodness know how long it will be before I get into work. One thing is for sure is that the battery power won't last the whole of the remaining time.

Fortunately, I have been able to make productive use of the time and have caught up on e-mail - a number fo replies are pending transmission - and have completed some paperwork. Last night I finished marking exam papers so I can't even fall back on these once my iBook falls into forced sleep B-} I suppose I could shutdown iTunes to eke out a few more minutes of operation but I'm listening to macAlias - yes that is the name of these two female singers! - and their helping me to relax and keep my mind off the frustrations of this journey.

Talking of sleeping iBooks, the uptime for my iBook is 7 days, 15:04! Mac OS X is steady as a rock - no doubt I will have tempted fate and something will now happen to cause me to have to shutdown/restart the machine rather than just put it to sleep. I'm going to see how long I can keep this machine going without a restart/shutdown.

If all els fails I can read and think. That would be a novelty ;-)
11:40:56 AM    


Hooks in Radio UserLand: "Tempted to edit something in system.verbs.builtins but scared that a subsequent update to Radio.root will wipe out your changes? Sick of having to paste your changes back in each time it happens? I'm developing a tool to make it a lot easier for you to develop yours. If you're interested, scan through this preliminary documentation and then join us in the forum. Thanks!"
1:09:26 AM    


© Copyright 2002 Duncan Smeed Click here to send an email to the editor of this weblog..



Click here to visit the Radio UserLand website.

 


January 2002
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Dec   Feb