Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
7

Migrating scripts from ExtendScript to UXP PageSideOptions and XMLElementPosition Enumerations issue

New Here ,
Jan 12, 2024 Jan 12, 2024

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. 
TOPICS
How to , Scripting , UXP Scripting
240
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 12, 2024 Jan 12, 2024
Translate
Community Expert ,
Jan 12, 2024 Jan 12, 2024
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2024 Jan 12, 2024
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines