Help with tab view scroll view nonsense

Hey guys,

Sorry if this has been answered, but I have been searching around and have not found an answer to my problem.

I have some code that is supposed to change the contents of a text view:

set contents of text view “gd_status” of scroll view “gd_status” of tab view item “libSetup” of tab view “stages” of window “installWizard” to “Worked!”

But each time it gets there in the app, I get a world famous NSReceiverEvaluationScriptError: 4 (1)

My problem might be that I havent “named” my scroll view, and I would love to do so, but I cannot seem to find out where to do that.

Closest I found was http://bbs.applescript.net/viewtopic.php?id=9664 where it mentions double clicking to get to the scroll view, but that just highlights the text for me.

One other question: anyone know of a good applescript studio book? I have the orielly applescript book, but I am looking for one that covers studio a bit more.

Thanks guys!

Model: Powerbook 1.33Ghz
AppleScript: Latest
Browser: Safari 412.2
Operating System: Mac OS X (10.4)

Could you use something like this instead?

set contents of text view “gd_status” of scroll view 1 of .

Well, I am not too sure I know which number scroll view this is, if applescript is indeed making scroll views for all my text, as there is a lot of text in that window.

There should be a way in IB to highlight something and click “reference” and it would spit out the long string of code that you need to reference that object.

Its index 5, and I tried changing it to 5 and still get the 4(1) action.

Have you tried “set content of.” instead of “set contents of.”?

Just did that, same error :slight_smile:

A single-click on the object (in IB) will select the scroll view. You should see 8 little blue around the object (one in each corner and one on each side). A double-click will take you to the text view. You should see a thick blue line around the object.

With the inspector palatte set the to Applescript section, the title bar will reflect the type of object you currently have selected, i.e.: NSScrollView Inspector, NSTextView Inspector, etc., etc.

I seem to recall something about working with tab views. I think the tab view that contains the object(s) to be updated has to be the current tab view. I may be mistaken about this.

Hope this helps,
Brad Bumgarner, CTA

Hmm, when I single click (and it has the blue buttons), it says “NSTextField Inspector” and says the same when I double click it.

Could this be something kind of new in the new xCode maybe?

Also, does it look like I am leaving anything out of the phrasing of that line of code? The text its trying to change is in the current tab view, so that shouldnt be a problem.

Thanks again.

Also, if anyone wants to take a look at the full project in the context and fix it, I could offer some compensation…

Brad is right. :slight_smile:

Perhaps that’s because you’re using a text field instead of a text view? Edit: See picture.

Wow, /me stupid :).

I changed it to:

set the text field “gdStatus” of scroll view “gdStatus” of tab view item “libSetup” of tab view “stages” of window “installWizard” to “Worked!”

which still fails me, as well as

set the content of text field “gdStatus” of scroll view “gdStatus” of tab view item “libSetup” of tab view “stages” of window “installWizard” to “Worked!”

Whats the best way for me to go about it?

Thanks again, I owe someone dinner after all of this.

Realizing its not in a scroll view, I took that part out and now get

NSInternalScriptError (8)

Just got it

	set the content of text field "gd_status" of tab view item "libSetup" of tab view "stages" of window "installWizard" to "Worked!"

Thanks and sorry for the waste of a last few posts! :slight_smile: