Indesign - script personnal order for object style
Hello,
I am looking to write a script to rearrange my object styles (with much subgroups) according to a personal order.
Just a short example:
MY_PRINCIPAL_STYLE_HORIZONTAL
MY_SECOND_STYLE_HORIZONTAL
MY_PRINCIPAL_STYLE_VERTICAL
MY_SECOND_STYLE_VERTICAL
In this specific case, I saw that it required :
- - renaming with a number
002_MY_SECOND_STYLE_HORIZONTAL
001_MY_PRINCIPAL_STYLE_HORIZONTAL
004_MY_SECOND_STYLE_VERTICAL
003_MY_PRINCIPAL_STYLE_VERTICAL- - then sorting by name
001_MY_PRINCIPAL_STYLE_HORIZONTAL
002_MY_SECOND_STYLE_HORIZONTAL
003_MY_PRINCIPAL_STYLE_VERTICAL
004_MY_SECOND_STYLE_VERTICAL- - and then removing the number.
MY_PRINCIPAL_STYLE_HORIZONTAL
MY_SECOND_STYLE_HORIZONTAL
MY_PRINCIPAL_STYLE_VERTICAL
MY_SECOND_STYLE_VERTICALWith ChatGpt and Mate, I make three scripts for the moment. I'm stuck on part 2 taken from this post. This code app.menuActions.itemByID(113168).invoke(); doesn't always seem to execute correctly on each run.
I use Indesign 2021 in my work. Is there a better way to invoke this action?
