(This is such a newbie question!)
I’m trying to make a very simple script that will convert the contents of a text tab into uppercase - either only the highlighted selection, or the entire tab if no text is selected.
So far I’ve come up with this - I know it has many problems though.
It won’t catch glyphs if they are not in the dictionary: i.e. .001, .002, ss.01, ss.02 or glyphs with nonstandard unicode names
A solution I’ve tried looking at is instead of using the glyph name, use the unicode, but trying unicode(eachGlyph) still returns the glyph name? Or, do some kind of grep (or filter?) to catch anything with a (glyph).(feature), i.e. /g.ss01, and strip and convert to /G
If no text is selected, it only converts the glyph after the cursor position.
It still only opens a new tab instead of converting the text in the current tab (maybe this is better anyway).
Ligatures…
Breaks at linebreaks (edit: works tentatively now at linebreaks)
Also, a.ss01 would probably only rarely correspond with A.ss01 ?
I incorporated your code into this gist but I’m curious why it still doesn’t work from the scripts folder - it hangs and crashes, but it works as a script inside the macro panel (Version 1.4.4 (602)), v2 works fine!
Furhtermore, how can I make the script:
Replace highlighted text instead of creating a new tab