I'm trying to create a NSTextField to allow batch renaming of some files. This field should allow to insert some tokens to customize each filename. The problem with NSTokenField is that 1) it trims whitespaces, which should be allowed, 2) it doesn't have enough features to mix tokens and plain text as I want, for example, it should recognize the start of a token even if the actual style is plain text.
Now I thought of subclassing NSTextField or NSTextView to draw my tokens manually, but how can I make each token act as if it was a single character? Can I somehow add a NSCell with some text?