On 7/24/20 at 9:36 AM,
stephen...@gmail.com (Stephen Taylor) wrote:
>Is there a way to do this in BBEdit? I hacked together a simple
>javascript to do it, but then I have to run that as a local webpage;
>MADEEKLP -> M,A,D,E,E,K,L,P, ...
Looks like a fairly simple thing to do with Find/Replace, e.g.,
Find:
([A-Z])
Replace:
\1,
[A-Z] matches a single upper case ascii letter.
The parens capture that matched letter.
The \1 in the replacement is that captured value (the first one,
and in this case the only captured value).
This will do most of your work, although you might not want the
comma at the very end after the the very last letter. And there
might be other edge cases.
If your JS script works well, note that BBEdit can run scripts
written with Apple's script editor, and - unknown to many -
Apple's Script Editor accepts scripts written in javascript as
well as those written in AppleScript. So you might want to check
that out. A script can often be more versatile and robust than
using find/replace.
HTH
--
- Bruce
_bruce__van_allen__santa_cruz__ca_