Oh man oh man!

How do I reference a NSTextView field (called field1) in window (called main)?

tell window “main”
set contents of text view “field1” of scroll view “field1” to “abc”

…the above doesn’t seem to work. Not sure about the scroll view stuff either.

Is there a standard way to determine how to reference a Cocoa GUI component in AppleScript studio? For example a NSTextField component (called field2) is referenced as follows:

…text field “field2”…

How do I reference other components such as a NSTableView, etc?

Man if only there was a decent AppleStudio manual! :rolleyes:

Anyway, thanks in advance.

you need to be clear on whether you are referencing a text field
or a text view they are two different things.
and make sure that the names you are using are the names you have specfied in the applescript pane in IB. If in doubt: tell text view 1 of scroll view 1 of window 1 etc.

maybe thats the problem…?


and also, make sure that they are not within boxes or any other container

I came across a post about single-clicking and double-clicking to select NSScrollView and NSTextView components respectively, from which I discovered the NSScrollView was not named.

Now I need to know how to reference a NSTextField (i.e. a label) and am looking at populating a NSTableView.

Man oh man I wish Apple had a straight forward doco detailing these GUI components. That said, at least they’ve provided several examples.