Checking for a real object using the stringValue as the identifier seems very hacky, although I know what you were trying to fix there
In general, text objects don’t have identifiers, but they did for a brief period as you probably remember. I think that code was there so any triggers (or other stored QSCommands) created during that period would still work. So most of the time, it doesn’t do anything.
But I too question using stringValue now. Since we know exactly what we’re after, it seems like objectForType: would work just as well.