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

Migrating scripts from ExtendScript to UXP PageSideOptions and XMLElementPosition Enumerations issue

New Here ,
Jan 12, 2024 Jan 12, 2024

Copy link to clipboard

Copied

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

Views

102

Translate

Translate

Report

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

Votes

Translate

Translate
Community Expert ,
Jan 12, 2024 Jan 12, 2024

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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