apostrophe breaks string conversion

Hi All,

I just found an odd thing. I have an array controller and two tables connected via bindings. I access the table view for “exclude items” via:

set excludeList to theTableValues's valueForKey_("excludeList")
set excludeListString to ""

repeat with i from 1 to (count of excludeList)
	set excludeListString to excludeListString & ((excludeList's objectAtIndex_(i - 1)'s valueForKey_("excludeItem")) as string) & return
end repeat

log excludeListString

Now it works all fine until one of the “excludeItem” lines has an apostrophe in it. Then it will not convert the key value to a string.

Any thoughts anyone?

Thanks , Rob

Ok I just realized the issue is not with the string not getting converted. That all works fine. It is that later in my code it is then quoted to send via the echo command so the quoted line fails with that extra apostrophe. I have to read in the line and escape the single quote if possible.

Sorry for answering my own question.