Macro: select Color Palette Next jumps to the very last of the palettes.

I am seeking some help with a Macro which is not behaving in the way I think it should.
It is Color Palette Next issue where if I am in Color Palette 1 and I use the macro to record Color Palette Next... it jumps up to the very end of my existing palettes; not to Color Palette 2, which is the next available unrecorded color palette. So, even if I have a space with many unrecorded color palettes, but I have color palette 900 recorded; the next color palette ends up being color palette 901. What I would like is the macro to select the "Next Empty" color palette.
Here is the macro I am using:
Select_Active Color_Gel_Match_Spectrum 3/105 ◊ 
Record Color_Palette Next ◊
Label Orange ◊
Does anyone have answer to this dilemma? Is there a good work around?

moved to appropriate forum
[edited by: eos moderator at 11:32 PM (GMT -5) on Wed, Oct 18 2023]