Random Character Alternative Issues

I am so confused.

I’m creating an all-capitals handwriting typeface that that contains multiple versions of characters and I’d like them to rotate through within words — for instance: if i typed the word “ABRACADABRA”, I’d like each A to be a different character, each B, each R, etc.

I’ve set up rules for double letters to be replaced with ligatures (EE, SS, NN, TT, etc) but haven’t been able to crack cycling through characters within a word, when they are separated by other characters. For instance, in the word “INTERESTING” I’d like both I’s to be different, both T’s to be different, etc.

Does someone have a magic spell that can help me out?

I’ve been poking around in this article I found recommended in another thread:
but admittedly, it’s a bit daunting.

Have you seen this: https://glyphsapp.com/tutorials/features-part-3-advanced-contextual-alternates

Yea, I’ve been working with the code they suggest, but having no luck. It gives me a syntax error every time even when I (assume I) have everything labeled correctly.

Error: “invalid token (text was “?”)” in Feature calt in line: 1

Hi, I’m currently in a similar process. Have you tried the Create Pseudorandom Calt Feature script by Rainer? https://github.com/mekkablue/Glyphs-Scripts/blob/master/Features/Stylistic%20Sets/Create%20pseudorandom%20calt%20feature.py

It writes the necessary code automatically (while also generating the classes). You can also find a script in the same repo that syncs your stylistic sets for you in order to generate the classes. It works great until export, where Glyphs gives a “duplicate production names” error. But that calls for a different forum topic, I guess. Good luck!

Oh then I need to fix the script. Did you make sure you have the latest version of the script? If so, can you add an issue on GitHub?