applying a return to text in text filed

I have a NSTextField that has text added to it from this line of code, which works fine

FFNF's setStringValue_(FileName as string) 

What I am trying to do is have a return added to the end of the (FileName, so the next entered text in the text field via the above code goes below the first entered FileName, and so on down the list

I have tried applying a return like as below, this errors

FFNF's setStringValue_(FileName as string) & return

the out come would look something like this.

123456
787878
345-D

how would I go about this please?, hopefully I haven’t missed the obvious.

cheers

Hi,

indeed it should be obvious, put the right parenthesis rightmost

yup your right it was obvious :rolleyes: :smiley:

that has fixed the error, yet the text in the text field will not apply the return, all that happens is the text
that is already in the text field gets replaced with new text

The outcome where? Are you putting these file names into a multi-line text field?

Ric

gidday

yes, well i’m trying to

You’re going to have to get the existing text from the field, concatenate the new text, and set the field’s contents to the result. You can’t directly add to a text field like you’re trying.

thanks for the input guys

I ended up with this which works fine

set ModText to FFNList's stringValue()
                FFNList's setStringValue_(FileName) -- set the string
                set GetText to FFNList's stringValue() -- get the string            
                set ListText to (GetText as string & return)
                FFNList's setStringValue_(ListText & ModText) -- new list

cheers