Wednesday, July 18, 2018

#1 2003-01-23 12:28:01 pm

JBadger
Member
From:: Calgary, Alberta
Registered: 2002-12-08
Posts: 12
Website

Text field in a drawer

Hi everyone!

I am having trouble...
I have a text field in a content view in a drawer, and I want to change the contents of the text field. How would I reference it?

I have tried these two things:

Applescript:


on clicked theObject
   if name of theObject is "A" then
       set the (title of text field "element name" of drawer "info drawer" of window "main") to "A"
       end if
end clicked

and this:

Applescript:


on clicked theObject
   if name of theObject is "A" then
       set the (contents of text field "element name" of drawer "info drawer" of window "main") to "A"
       end if
end clicked

I'm still learning AppleScript Studio, so forgive me if I act noobish.
yikes

Thanks

Offline

 

#2 2003-01-27 10:23:18 am

T.J. Mahaffey
Administrator
From:: Arkansas, USA
Registered: 2002-11-20
Posts: 238
Website

Re: Text field in a drawer

What happens if you word it like this?

Applescript:

on clicked theObject
   if name of theObject is "A" then
      set contents of text field "element name" of drawer "info drawer" of window "main" to "A"
      end if
end clicked

If that doesn't work, I'd check to be sure that "element name" is, in fact, a text field and not something else like a scroll view. Fields can be a bit confusing.
Regardless, I think it's 'contents' that you're trying to work with here.


T.J.
tj@tjmahaffey.com

Offline

 

#3 2003-01-31 06:34:55 pm

JBadger
Member
From:: Calgary, Alberta
Registered: 2002-12-08
Posts: 12
Website

Re: Text field in a drawer

Thanks, but I decided to do it differently in the mean time. I'll remember that for future use.  smile

Offline

 

#4 2003-02-13 12:30:14 pm

Alan Ramos
Member
From:: NYC
Registered: 2003-02-04
Posts: 4
Website

Re: Text field in a drawer

Yes, on referencing fields I had on a few occasions mislabeled text fields and text views.  Sometime I still muck up the text view of "somename" of scroll view "somename".  I don't know why it just doesn't seem right to reference twice.  Afterall by that example I would be trying to use the scroll view "somename" so what would make calling it a text view different?  Oh well..

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)