NSString doesn’t understand the “stringWithString_” message
Answer from an Apple thread:

As of Yosemite, ASObjC is available everywhere, not just libraries and applications.  Importing the desired terminology via the use statement is now directly supported in the Script Editor - for your example, the NSString class stuff is available by adding a use framework &quot;Foundation&quot; statement.