var myMenuAction = app.menuActions.item("$ID/Untag Text");
This gives an alert of "false" if its executed after the preferences are trashed, however if i select some tagged text and right click so that the context sensitive menu containing the "Untag Text" is visible then the above code snippet gives "true" as an alert and remains so that way unless the preferences are again trashed. I am not sure why this is happening and how is this implemented in InDesign, somehow clicking once to show the menu creates that object of MenuAction and then it's accessible. Does preferences somehow preserve this information, are these objects serialised in preferences?
It will be very helpful if the august members of this forum could shed some light on this query and how best to make sure that the above line of code works independent of the preferences state.