Wednesday 13 January 2010

TiddlyWiki WikiWordMaker Boxer Macro

macro WikiWordMaker(){
  int selectionWidth, i;
  string str;
  Cut;
  selectionWidth = GetClipboardText(str, 0);
  PutString("[[");
  Paste;
  Right(selectionWidth);
  PutString("|");
  Paste;
  for(i = 0; i < selectionWidth; i++){
    SelectRight;
  }
  CaseWords;
  Deselect(0);
  Right(selectionWidth);
  PutString("]]");
}

So I've been playing with TiddlyWiki in preperation for doing the M255 and I was getting really rather tired of having to copy and paste and edit all the words and phrases I was using as tiddlyWords. The software is cool but I was getting too tired to continue due to the chore of having to enter square brackets all over the place. That is until I realised that I could use It's All Text! and get Boxer to do the heavy lifting.

Should anyone in the know think they can do a better job of the Macro then please be my guest, only please let me know how it could be improved! I reckon I should get it the check if a word or phrase is selected but I'm not sure how to do that as I use the default Windows Clipboard rather than one of Boxers internal ones.

Now if I could only sleep I'd be a happy bunny!

Edit: It stopped working so I've altered it a little.

1 comment: