The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
February 1, 2004
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

Sunday, February 1st, 2004

I did a little bit of work this evening playing with the "Edit in BBEdit" functionality you see in various applications- mainly FTP clients. Anyway, I knew that the FTP program Fugu supported it and it's open source and hey- I should just steal what they are doing.

So that's what I did- I ended up writing a category for NSMutableAttributedString with a method called "openInEditor", which pretty much took the contents of the string, showed it in BBEdit, and whenever a save operation is done, the contents are updated. Why NSMutableAttributedString? Because it is extended by NSTextStorage which sits in NSTextView... and that's a pretty handy place to put it.

So here's the source to the example: FMEditInBBEdit.tgz, and if you make any changes to it, leme know. I pretty much just slapped this one together, and I don't really understand anything about apple events- but I do know how to cut and paste...

-- posted 10:42 pm