Operating system specific problems with InDesign APIs?

My plugin just got rejected in the review process. Now that, by itself, isn’t why I’m posting here. The reason I’m writing about this is that it alludes to some sort of operating system dependency in some InDesign API that (in my opinion) can only be a bug.

My plugin (the code of which you can find at https://github.com/pklaschka/indesign-pride-flagger/blob/main/index.cjs) was rejected for this reason:

When attempting to […] [run the plugin], a critical problem arises. Unfortunately, this results in the complete unresponsiveness and freezing of the entire InDesign application, making any subsequent actions impossible. The only practical course of action I discovered to exit InDesign was to utilize the Activity Monitor and forcefully terminate the application from that point.

While I had seen a similar problem on Windows while trying to use window.alert() (which I then removed because of this, cf. `window.alert` in a UXP plugin crashes InDesign - #3 by pklaschka), the plugin now uses nothing that should have anything to do with the operating system (in fact, I only use DOM APIs and two “more native” features, though still not seeming connected to the OS with app.eventListeners.add() and app.doScript()), and the described flow works without any issues on Windows. Unfortunately, I don’t have a Mac available for testing at the moment (which is also why I chose to, for now, focus on a plugin without any features that would interact with the operating system), so I can’t debug this.

So with that, I guess that this is a mix of a bug report (because I haven’t used anything that would justify a difference of behavior between operating systems) and a question: Does anyone have any idea what the problem here might be?

Thank you very much in advance for any help you can provide!
Zuri

Hmm… I managed to replicate this once on my machine, right after installing the plugin (which is awesome btw) for the first time. I was able to add a flag, then I did an UNDO, added another flag, and everything hung.

But after I restarted Id, I can’t duplicate that anymore, and it works flawlessly.

cc @pkrishna @Sujai — maybe we can ask the review team if they can repro consistently. May need to involve Eng to do some debugging here as there could be something Mac-specific going on.

1 Like

I tested it on my Intel Mac by loading the plugin from the UDT. Everything worked flawlessly and I was not able to reproduce the crash.

1 Like

Tried installing from a ccx file, also tried loading from UDT. It works fine in both cases and cannot reproduce the crash.

Environment:

  • macOS Monterey (12.6.7) Apple Silicon
  • InDesign 2023 (18.5.0.57)

Not sure if this is related, but I was wondering why it does not appear in the plugin menu after a successful installation. Is this expected behavior?

1 Like

Thanks, @kerrishotts, @tomzag, and @sttk3 (not that I’m any closer to a solution, but at least I know I’m not entirely crazy :wink: – it’s happening on other machines, too)!

I can’t speak to whether it’s expected (@pkrishna @Shruti ?), but it’s the same on my end.

PS: I’ll probably buy a Mac Mini to test stuff on macOS again :sweat_smile: . So hopefully, I’ll be able to begin at least debugging what’s going on next week or so :see_no_evil: … (I need to test macOS stuff on other projects, as well, since I’m now self-employed again, so it’s not just for this project, but I’m still not necessarily over the moon to spend roughly $ 1000 on something that I don’t want :neutral_face: )

1 Like

@pklaschka Your plugin just happened to uncover a random bug on Mac related to event loop processing. This is being looked into, thanks for reporting it.

2 Likes

@sttk3 The functionality of listing installed plugins under Plug-Ins menu isn’t available in 18.5. This is a work in progress, hopefully we could see it in 19.0.

2 Likes