It's been quite some time since I've used OSC on Arduino, in fact so long that the 2 libraries I used to use seem to have gone by the wayside (ZOSC and ArduOSC).
I'm wanting to use the outcome of part of the address in my OSC message to make decisions on what to do. More specifically I've used this method to map addresses for notes on an old organ, and used the message data as the note on/off:
Example:
Turn note 4 on = OSC message address=/note/4 data=1 (integer)
I would then simply extract the part of the address I wanted ('4') and if needed convert it to an integer, and use that to map to the solenoid outputs I have.