How to Identify the exact canceled operation?
Hi guys,
One can add an menuAction eventListeners on the "Cancel" command with :
app.menuActions.itemByID(265).eventListeners.add('onInvoke', handler);That will basically catch any cancel command that user fires.
I noticed that while the id remain constant, the menuAction name and title vary depending on the operation to cancel. That makes sense, no worries.
The problem I see is that I want to react for specific cancel commands, not all of them. Conceptually speaking, it would be ensuring the cancel menuaction name matches specific strings. And here the troubles begin.
For ex, if I edit document props in the UI, my French version will display "Annuler Format de document". But the latter string seems to be built on the fly based on the generic "cancel" menuaction. In other words, there are no specific canceling menuActions for every single command in the app.
Back to my issue, if I ambition to compare the menuAction name to a locale independant specific string, I can't.
app.findKeyStrings("Annuler Format de document") //returns nothing. But
app.findKeyStrings("Format de document") //returns $ID/Document Setup,$ID/Document Formatand
app.findKeyStrings("Annuler") //return $ID/Cancel
So I thought I could concat those strings identifiers and do something with them but soon realize I was drowning myself in a glass of water and searched in docs and here in the forum with no luck. So here I am to receive your lights 🙂
To sum things up, has anyone a hint to properly decrypt the command that is cancelable in the UI in a non-locale-dependent way?
Thanks in advance,
Loïc
