Skip to main content
Participant
January 13, 2024
Answered

Migrating scripts from ExtendScript to UXP PageSideOptions and XMLElementPosition Enumerations issue

  • January 13, 2024
  • 1 reply
  • 326 views

I have an extendscript that creates an Indesign document.  Refactoring the code to UXP isn't working for two different enumerators.  first 

if(myPage.side === PageSideOptions.leftHand){...}. ReferenceError: PageSideOptions is not defined
and second 
if (tagNamesAfter.includes(tagName)) {
myXMLElement.insertTextAsContent("\r", XMLElementPosition.AFTER_ELEMENT);
}
if (tagNamesBefore.includes(tagName)) {
myXMLElement.insertTextAsContent("\r", XMLElementPosition.BEFORE_ELEMENT);
} ReferenceError: XMLElementPosition is not defined. I understand that UXP is work in process.  are enumerators supposed to be referenced differently in UXP.  Any suggestions on workarounds would be appreciated.  These snippets work correctly in the extendscript version. 
This topic has been closed for replies.
Correct answer Manan Joshi

Check out the post linked below

https://forums.creativeclouddeveloper.com/t/enumerator-error-workaround/6629/2

-Manan

1 reply

Manan JoshiCommunity ExpertCorrect answer
Community Expert
January 13, 2024
jwhite462Author
Participant
January 13, 2024

Thank you for the fast response. I never thought to check the creativeclouddeveloper.com forum.  I works well as a workaround.