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

InDesign freezes when performing a script from a uxp plugin

New Here ,
Oct 07, 2023 Oct 07, 2023

Copy link to clipboard

Copied

I ask you to help in a solution, it is not clear why the InDesign is freezing when performing the script from the UXP plugin, not at every start, but once. It can perform several functions several times well, and then it freezes on the same functions ...

After some time, such an error appears:
<system platform="Windows 11 Pro" osversion="11.0" osbuild="22621" applicationlanguage="en-us" userlanguage="ru-RU" oslanguage="en-US" ram="16104" machine="13th Gen Intel(R) Core(TM) i5-13500H" model="Intel64 Family 6 Model 186 Stepping 2" cpuCount="16" cpuType="8664" cpuFreq="3187 MHz" processorArchitecture="9"/>
<gpu>
<gpuinfo availability="Running/Full Power" adapterCompatibility="Intel Corporation" adapterRAM="1024 MB" caption="Intel(R) UHD Graphics" description="Intel(R) UHD Graphics" driverDate="20230711000000.000000-000" driverVersion="31.0.101.4575" videoModeDescription="1920 x 1080 x 4294967296 colors" pnpDeviceID="PCI&#92;VEN_8086&#38;DEV_A720&#38;SUBSYS_01571558&#38;REV_04&#92;3&#38;11583659&#38;0&#38;10" installedDisplayDrivers="&#60;&#62;,igd10iumd64.dll,igd12umd64.dll"/>
<gpuinfo availability="Running/Full Power" adapterCompatibility="NVIDIA" adapterRAM="4095 MB" caption="NVIDIA GeForce RTX 4060 Laptop GPU" description="NVIDIA GeForce RTX 4060 Laptop GPU" driverDate="20230912000000.000000-000" driverVersion="31.0.15.3742" videoModeDescription="1024 x 768 x 4294967296 colors" pnpDeviceID="PCI&#92;VEN_10DE&#38;DEV_28A0&#38;SUBSYS_01571558&#38;REV_A1&#92;4&#38;4412DE9&#38;0&#38;0008" installedDisplayDrivers="nvldumdx.dll"/>
</gpu>
<crash exception="EXCEPTION_ACCESS_VIOLATION" exceptionCode="0xc0000005" instruction="0x00007FFC117315ED">

TOPICS
UXP Scripting

Views

660

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

Adobe Employee , Nov 21, 2023 Nov 21, 2023

@AntonN This issue is tracked with bug ID-4244210 internally and is prioritized.

Votes

Translate

Translate
Community Expert ,
Oct 07, 2023 Oct 07, 2023

Copy link to clipboard

Copied

Same or differrent INDD file(s)?

 

Do you have MISSING linked files in your INDD file?

 

...

 

Have you Googled for the reason of the exception?

 

Not restricted to a specific application, the EXCEPTION_ACCESS_VIOLATION error message occurs while using almost any application on your computer. Usually, the error message pops up when the application you are trying to run tries to access a protected memory address.

 

Try to download some memory checker / stresser tool and test your memory modules - depends on the machine it could be possible to do it from BIOS - at least on DELL workstations but they use registered memory modules.

 

But first - try to reseating them in the slots - if not soldered to the motherboard...

 

Or you have a virus or bad sectors on your drive.

 

▒► ID-Tasker / ID-Tasker Server - work smart not hard ◄▒

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
Adobe Employee ,
Oct 07, 2023 Oct 07, 2023

Copy link to clipboard

Copied

@AntonN Could you please help with filing a bug and attach the script which is causing the crash? Thanks!

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 ,
Oct 08, 2023 Oct 08, 2023

Copy link to clipboard

Copied

Thanks for the answers above.

 

@Anoop Valomkot I made a plugin menu for cleat text overrides, formatting text and tables, using the example of the clear overrides menu, as a rule, in most cases the script will work correctly, but sometimes Indesign just freezes, no errors in the console, nothing. I am attaching the function code.

 

ClearOverrides.idjs // =========================================
const { app, ScriptLanguage, UndoModes } = require("indesign")
const {
  create_wrapper,
  back_to_menu,
  watch_selection,
  run_done,
  clean_err,
  set_progress,
  get_stories,
  catch_error,
} = require("./functions.js")

function zco_main() {
  const script_name = "Clear Overrides"
  const doc = app.activeDocument

  const [z_wrapper, z_main_wrapper] = create_wrapper()

  z_wrapper.innerHTML = `
    <sp-action-button quiet id="z_title" class="z_title">
      <div slot="icon" style="fill: currentColor">
          <svg viewBox="0 0 18 18" style="width: 16px; height: 16px;">
          <path class="fill" d="M6,9a.994.994,0,0,0,.2925.7045l3.9915,3.99a1,1,0,1,0,1.4355-1.386l-.0245-.0245L8.4095,9l3.286-3.285A1,1,0,0,0,10.309,4.28l-.0245.0245L6.293,8.2945A.994.994,0,0,0,6,9Z" />
          </svg>
      </div>
      ${script_name.toUpperCase()}
    </sp-action-button>
    <sp-picker placeholder = "Область обработки">
      <sp-menu id="z_picker_items" slot="options"> 
        <sp-menu-item> Entire document </sp-menu-item>
        <sp-menu-item> Selected fragment </sp-menu-item>
      </sp-menu>
    </sp-picker >
    <sp-button variant="cta" id="z_btn"> ${script_name}</sp-button>
    <sp-progressbar id="z_progress" max=100 value=0 show-value="true">
      <sp-label slot="label">Выполнение...</sp-label>
    </sp-progressbar>
    <sp-body id="z_error" class="z_error"></sp-body>`

  const z_title = document.getElementById("z_title")
  const z_picker = document.getElementById("z_picker_items")
  const z_btn = document.getElementById("z_btn")
  const z_progress = document.getElementById("z_progress")
  const z_error = document.getElementById("z_error")

  let sel = watch_selection(z_picker, z_btn)

  doc.eventListeners.add("afterSelectionChanged", () => {
    sel = watch_selection(z_picker, z_btn)
  })

  z_picker.onchange = () => {
    sel = watch_selection(z_picker, z_btn)
  }

  z_title.onclick = (e) => {
    back_to_menu(doc, z_wrapper, z_main_wrapper)
  }

  z_btn.onclick = (e) => {
    e.preventDefault()
    zco_run()
  }

  async function zco_run() {
    // run_done(z_wrapper, z_btn, script_name, true)
    z_btn.setAttribute("disabled")
    clean_err(z_error)
    set_progress(z_progress, 30, "block")

    return new Promise((resolve) => {
      setTimeout(() => {
        app.doScript(
          clear_overrides,
          ScriptLanguage.JAVASCRIPT,
          [],
          UndoModes.ENTIRE_SCRIPT,
          script_name
        )
        resolve()
      }, 750)
    }).then(() => {
      setTimeout(() => {
        // run_done(z_wrapper, z_btn, script_name, false)
        z_btn.textContent = script_name
        z_btn.removeAttribute("disabled")
        set_progress(z_progress, 0, "none")
      }, 1500)
    })
  }

  function clear_overrides() {
    console.log("Clear Overrides")
    try {
      if (z_picker.children[0].hasAttribute("selected")) {
        const stories = get_stories(doc)
        for (let s of stories) {
          if (
            s.textContainers[0].parentPage.parent != "[object MasterSpread]"
          ) {
            s.clearOverrides()
            s.footnotes.length &&
              s.footnotes.everyItem().texts.item(0).clearOverrides()
            s.tables.length &&
              s.tables
                .everyItem()
                .cells.everyItem()
                .texts.item(0)
                .clearOverrides()
          }
        }
      }

      if (z_picker.children[1].hasAttribute("selected")) {
        if (sel.words && sel.constructorName == "TextFrame") {
          const story = get_stories(sel)
          story.clearOverrides()
          story.footnotes.length &&
            story.footnotes.everyItem().texts.item(0).clearOverrides()
          story.tables.length &&
            story.tables
              .everyItem()
              .cells.everyItem()
              .texts.item(0)
              .clearOverrides()
        } else if (sel.words && sel.constructorName != "TextFrame") {
          sel.texts.item(0).clearOverrides()
          sel.footnotes.length &&
            sel.footnotes.everyItem().texts.item(0).clearOverrides()
          sel.tables.length &&
            sel.tables
              .everyItem()
              .cells.everyItem()
              .texts.item(0)
              .clearOverrides()
        }
      }

      set_progress(z_progress, 100, "block")
      z_btn.textContent = "Success"
    } catch (err) {
      catch_error(z_error, err)
    }
  }
}

module.exports = { zco_main }

// =================================================
index.js // ========================================
const { entrypoints } = require("uxp")
const { app } = require("indesign")
const { create_ui, reload_plugin } = require("./functions")
const { zvc_main } = require("./ZebraVerifyConcept.idjs")
const { zco_main } = require("./ZebraClearOverrides.idjs")
const { zft_main } = require("./ZebraFormatText.idjs")
const { ztb_main } = require("./ZebraFormatTable.idjs")
const { zgp_main } = require("./ZebraGraphPlacement.idjs")
const { zbf_main } = require("./ZebraBreakFrames.idjs")

/* 
================================ Нейминг =========================================
   *** zvc - ZebraVerifyConcept
   *** zco - ZebraClearOverrides
   *** zft - ZebraFormatText
   *** ztb - ZebraFormatTable
   *** zgp - ZebraGraphPlacement
----------------------------------------------------------------------------------
*/

entrypoints.setup({
  panels: {
    Zebra: {
      create(rootNode) {
        return new Promise((resolve) => {
          create_ui()
          app.addEventListener("afterContextChanged", reload_plugin)

          const zvc = document.getElementById("zvc")
          zvc.addEventListener("click", (e) => {
            e.preventDefault()
            zvc_main()
          })

          const zco = document.getElementById("zco")
          zco.addEventListener("click", (e) => {
            e.preventDefault()
            zco_main()
          })

          const zft = document.getElementById("zft")
          zft.addEventListener("click", (e) => {
            e.preventDefault()
            zft_main()
          })

          const ztb = document.getElementById("ztb")
          ztb.addEventListener("click", (e) => {
            e.preventDefault()
            ztb_main()
          })

          const zgp = document.getElementById("zgp")
          zgp.addEventListener("click", (e) => {
            e.preventDefault()
            zgp_main()
          })

          const zbf = document.getElementById("zbf")
          zbf.addEventListener("click", (e) => {
            e.preventDefault()
            zbf_main()
          })

          resolve()
        })
      },
      destroy(rootNode) {
        return new Promise((resolve) => {
          console.log("Destroy panel")
          resolve()
        })
      },
    },
  },
})

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 ,
Oct 08, 2023 Oct 08, 2023

Copy link to clipboard

Copied

When InDesign freezes, it does not show console.log("Clear Overrides"), although this is the very beginning of manipulating objects in InDesign. When it runs normally, it does. Sorry for my English.

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
Adobe Employee ,
Oct 08, 2023 Oct 08, 2023

Copy link to clipboard

Copied

@AntonN I would need the whole plugin to reproduce this issue and investigate. The information shared about the crash is very generic and doesn't help me with the details on what caused it. I also doubt if I can just run the snippet shared by you, it seems to be importing other files. Would you please reach out to me on slack or via email?

 

Please also try the plugin on 19.0 prerelease build and let me know, there are stability fixes in those builds.

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 ,
Oct 08, 2023 Oct 08, 2023

Copy link to clipboard

Copied

@Anoop Valomkot Thank you! Yes, you are right, the plugin is modular. I can email you the entire plugin package, please write it.

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
Adobe Employee ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

Hi @AntonN,

Hope you're doing well!

We wanted to follow up on the issue you've reported. Are you able to collaborate with @Anoop Valomkot, and is the issue resolved for you?

Please let us know if you need further assistance. We will be happy to help you.

 

Thanks,

Harshika 

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 ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

@HARSHIKA_VERMA Hi! Thank you for your attention to this problem, it still exists unfortunately. The plugin randomly freezes when calling the app.doScript function, and after that it is no longer possible to work normally with documents in InDesign. Moreover, Indesign does not give an error, but the spinner simply spins endlessly. @Anoop Valomkot asked me to send him a spindump from a Mac, but I don’t have access to it, but I sent him a memory dump from Windows in a private message, I haven’t received a response yet. By the way, in Indesign 18.5, this random freeze happened more often, starting from version 19 it is less common, but is still present. The bug fix list on your website states that the random freezing bug when running app.doScript from a plugin is fixed in version 19, but this is not the case, unfortunately.

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 ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

I would be very grateful for any help in solving this problem.

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
Adobe Employee ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

@AntonN This issue is tracked with bug ID-4244210 internally and is prioritized.

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 ,
Nov 22, 2023 Nov 22, 2023

Copy link to clipboard

Copied

@Anoop Valomkot Thank you very much! I really hope that this issue will be fixed in the next versions of InDesign.

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 ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

LATEST

@Anoop Valomkot Hi! Please advise whether this problem can be resolved and when approximately we can expect a possible InDesign update with this problem resolved?

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