Thanks for reporting it to Shane and Mark. (He already should have received a dozen of crash logs through SD from me today
And thanks for the script!
I was using for years my AppleScript for BBEdit to extract from CSVs. These days I was playing around with the Perl stuff, to add compatibility with delimiter-containing fields.
But now I’m merging your ASOC script into my existing AS, also because of portability reasons. (The script is used by two other people, too, and I’m not eager to explain them that now they have to install some weird Perl module with CPAN…)
Changing newlineCharacterSet() to whitespaceAndNewlineCharacterSet also works without error, but it makes the script fail.
Shane says:
“Something is happening inside AppleScript that's causing the character set to be prematurely released from memory, and hence a crash when that memory is accessed later. The result is a bit like the -4690 errors that can happen under OS X 10.10.
Why it happens when you use the method newLineCharacterSet(), and not when you treat it like a property, is not clear. The latter is the same as using -valueForKey:, and for some reason that approach is not triggering the premature release. All I can suggest is that what you have appears a good workaround; there are good reasons not to use the key-value approach in some cases, but they don't apply here.”
I'm going to change the original script to reflect the fix you found, because it works and is the least effort.