YAY, looks like I can actually help someone in the dev forum!!! I'll mark this day with golden stars in my calendar
The problem is only with extension actions, inbuilt actions will keep their numbers. To reliably call extension actions from a script use RPR_NamedCommandLookup(custom ID) instead of the Cmd ID. You find the custom ID string in the column to the right of Cmd ID in the action list.
This (python) will call 'SWS set selected item to custom color 1'
Code:
SWS_ITEM_COLOR_1 = RPR_NamedCommandLookup('_SWS_ITEMCUSTCOL1')
RPR_Main_OnCommand(SWS_ITEM_COLOR_1, 0)
It's a two step thing. First you get the handle to the action with RPR_NamedCommandLookup and then call the action with RPR_Main_OnCommand
WIKI link (with examples):
http://www.cockos.com/wiki/index.php...dCommandLookup