Free TextWrangler editor and BlitzBuddy

Archives Forums/MacOS X Discussion/Free TextWrangler editor and BlitzBuddy

SJB(Posted 2005) [#1]
For those who don't know, the TextWrangler editor from Bare Bones is now Free! TextWrangler is a subset of BBEdit. It does not include some of the advanced features of BBEdit, such as the advanced HTML tools and glossary.

It will work fine with BlitzBuddy for developing BlitzMax projects, and I now include relevant scripts for it in the BlitzBuddy distribution. The editor is much more advanced than the standard BlitzMax 'IDE'.

I have released a new version of BlitzBuddy, which is available here


Richard B(Posted 2005) [#2]
Hi SJB,
I am just testing out BlitBuddy to see if a change over is viable. I am having one problem (with v1.2) in that the "failed Script" is causing BlitzBuddy and BBEDit to hang until the apple event times out (after which it appears to create the errors window correctly in BBEdit etc). The offending section seems to be the try-end try section. I suspect this is a problem at my end, but any help in sorting this would be appreciated.

Apart from this problem is sems to work great!

thanks,
Richard.


SJB(Posted 2005) [#3]
Strange, I don't have a problem. Try this:
* Check the option 'Display scripts before executing' in the BlitzBuddy preferences dialog.
* Do a build. You should see the script printed in the BlitzBuddy window.
* Highlight and copy the script text (from the 'set errorlist...' to '..end tell'
* Open Script Editor.
* Paste the script into script editor
* Run the script.
Do you see the same problem?
If not it may well be something BlitzBuddy is doing.
Other questions:
How long is the delay and how fast is your Mac? If it is a slow machine it may be taking some time for AppleScript to compile the script before executing it.
I assume that you are leaving BBEdit running between builds? Does it make a different if BBEdit is not running when you do the build from the BlitzBuddy window (AppleScript should run it when the script executes)?

Simon.


Richard B(Posted 2005) [#4]
Hi Simon,

If I cut and paste the script code from the BlitzBuddy window, paste it into the Apple script Editor and run it from there it works perfectly.

If I quit BBEdit and "Build" the code directly using BlitzBudddy then BBEdit doesn't launch (even though the BM code has an error).

If I keep BBEdit open and do the "build" directly using BlitzBuddy then the error script runs without problems (ie reports the error in the BBEdit Blitz Buddy window).

The problem only seems to arise if I try and do the build from within BBEDit. The exact BBEdit error i get is "BlitzBuddy got an error: AppleEvent timed out".

Another, possibly linked, thing is that if I build error free BM code using BBEdit then the "Success Build Script" is reported in the BlitzBuddy window as failing ie the following is output:

Compiling:maxCubeMin.bmx
Linking:maxCubeMin
Executing Successful Build Script

tell application “BlitzBuddy”
run
end tell

Successful Build Script failed
Build Successful


thanks for your help,
Richard.

PS I am on a dual G5 running 10.3.7


MRaven(Posted 2005) [#5]
Great news. Have to try it as soon as possible.
Thanks for sharing this. :)


SJB(Posted 2005) [#6]
Hi Richard,
I have found the problem and will post a new version as soon as I can.


Richard B(Posted 2005) [#7]
Great! We really need an improvement on the current Blitz IDE - at the very least some sort of class browser. Hopefully BlitzBuddy does the trick :-)

Did you have a look at SubEthaEdit? Is it's apple script support too weak?

thanks for chasing it up,
cheers,
Richard.


SJB(Posted 2005) [#8]
Yes I did look at SubEthaEdit. I couldn't see any way of positioning the cursor in the file, so the fail script wouldn't be much use. I also seem to remember that it did not have a scripts menu that the build script could be attached to. Maybe there is a way to do it, but I couldn't work it out. Its always the same problem with AppleScript - looking at an applications AppleScript dictionary tells you nothing about how to actually use the commands.

I also looked at TextMate. It basically does not have AppleScript support, but its 'run command' (or whatever it is called) stuff might be able to be set up to do some integration along with th osascript command. I didn't try it though.

I have fixed the problem you have been having. I hope to post it this evening (NZ time) - I will try to actually test it properly this time :).


SJB(Posted 2005) [#9]
OK, I have posted a new version on the web site http://www.simulacrum.net.nz/blitzbuddy.php


Richard B(Posted 2005) [#10]
Works perfectly now!

thanks,
Richard.


Richard B(Posted 2005) [#11]
Mmmm....almost perfect ... when the BM code compiles OK - it doesn't run the output file eg the follwoing is output:

Compiling:exp.bmx
Linking:exp
Build Successful

Executing Successful Build Script

tell application “BlitzBuddy”
run
end tell

Successful Build Script failed

but nothing is actually run. If I click the "Run" on blitzBuddy then it does run.

Richard.


Richard B(Posted 2005) [#12]
Found why the applescript failed to run - it was because I had copied and pasted the script from Preview which ssems to paste strange inveted comma's. I hand edited thse and now I get
Compiling:exp.bmx
Linking:exp
Build Successful

Executing Successful Build Script

tell application "BlitzBuddy"
run
end tell


ie no "Successful Build Script failed" this time, however, still nothing happens. If I run the script using Script Editor again nothing happens until I eventually get "BlitzBuddy got an error: AppleEvent timed out".

sorry about this,
Richard.


SJB(Posted 2005) [#13]
Oops! Silly mistake on my part. I have uploaded 1.2.2, which (fingers crossed) fix it.
This is the first time I have implemented AppleScript support in an application. It's all a bit complicated and confusing. The Apple docs leads you to believe it is all wonderfully easy to do and Cocoa handles most of it for you. Unfortunately that's not quite true.


Richard B(Posted 2005) [#14]
Dare I say it... works perfectly!

Thanks for the quick reponses (and curse all docs).

cheers,
Richard.


Richard B(Posted 2005) [#15]
One more thing, where does the console output end up? If I have a print statement in the BM code the output goes to the MB IDE consule - but I can't see where BlitzBuddy is putting it!?

many thanks,
Richard.