Setting Tab Stops with Applescript

I am working on a project that uses a text view that gets populated with text from other areas in the application. I need to set tab stops in this text view for formatting purposes. I don’t want to do this manually using a visible ruler. To me this looks like something that has to be done using methods. I have read Mooresan’s thread “Cocoa for Applescripters Part 1” and I have tried to follow it as best I can but, so far, I haven’t been able to wrap my brain around this concept very well (YET). I have even copied the entire thread into a TextEdit file so that I can read offline until it begins to make sense.

I have looked at methods involving NSRulerView and NSParagraphStyle. NSParagraphStyle looks like it is what I would need but I can’t figure out how I would apply that to the text in my text view/scroll view object. With NSRulerView I should be able to set/remove tab stops but I can’t figure out how to access the correct object(s).

I have set up a test project specifically to figure this out, but I haven’t had any luck yet. This project consists of a single window with a text view/scroll view object and a button connected to the scroll view to toggle a ruler on and off (I can do that in IB) so that I can see if I am getting any results. I have another button that I am using to figure out what I’m doing. A sample line of code:

set theTabs to call method "Markers" of (scroll view "theScrollView" of window "Main")

doesn’t return anything.

btw, everything in this project has been named and linked in IB.

I’m just beginning to understand, not only where to find the methods, but also how to use them. I think I’ve got a ways to go.

Thanks in advance to anyone that can help,
Brad Bumgarner, CTA