I have a script that needs to split strings into their component sentences. I’ve been using BridgePlus’s sentencesOfString:
but I want to run this script via osascript (which won’t work with BridgePlus). So, I’m trying to reverse engineer sentencesOfString:
in ASObjC.
This is as far as I got:
set theInput to "Lorem ipsum dolor. Ut enim ad minim. Duis aute irure."
set theApp to current application
set theString to theApp's NSString's stringWithString:theInput
set theRange to theApp's NSMakeRange(1, (length of theInput))
set theResult to theString's enumerateSubstringsInRange:theRange option:(theApp's NSStringEnumerationBySentences)
Gets the error -[__NSCFString enumerateSubstringsInRange:option:]: unrecognized selector sent to instance 0x7ff1adfb5780
I think the issue is that I’m specifying the range wrong but I don’t really know!