get text content of cell in a form?

Maybe I’m trying to be overly fancy here, but I’m trying to use the NSForm object. I can’t find any documentation on this object in the local AS Studio documentation files, and so far not online either.

How do you properly refer get the text content of the individual items on the forms, and in what handler would you properly check for changes?

It so happens I have this form in a box on a tab view item, so what I’m trying now is:

tell tab view item "network" of tab view "maintabs" of window "main"
		tell box "localbox"
			set lanip to contents of cell 0 of form "localform"
			--set netip to cell 1 of form "localform"
			--set localhome to cell 2 of form "localform"
		end tell
		tell box "remotebox"
		end tell
   end tell

but even that one line in the first box tell block will not compile in xcode.


jacques… thanks, i already abandoned it though… i figured out it was a matrix, but i was getting errors trying to refer to it on a box. i just went with normal text fields in the end… but i’ll file it for future reference and hope it’s useful to others.

in case this of use to anyone, i figured this out, years later :wink:

  1. give each form cell an applescript name, with padded numbers at the the end, like “formcell01”, etc. (this is to set data in the cells); set “on clicked”
  2. tag each cell also with the same number; set “on clicked”
  3. connect the form to the applescript but don’t connect “on clicked”
property StringList: {"hello","goodbye","joe"}

on clicked theObject
-- to set cell text

if name of theObject is "setform"
-- use a button to open a panel or drawer or do it in awake from nib or whatever
tell window "main"
	tell matrix 1
				-- from: (page 400)
				repeat with i from 1 to (count StringLIst)
						set this_text to item i of StringLIst
						if i < 10 then
							set cellname to "formcell0" & i
							set cellname to "formcell" & i
						end if
						set string value of cell cellname to this_text
				end repeat
	end tell
end tell
else if name of theObject begins with "formcell" then
set entered_text to string value of theObject
		set celltag to tag of theObject
		set item celltag of StringList to entered_text
end if
end clicked