[BUG] `open` event never fired if Ps is opened with a document directly

I have multiple issues with testing this properly to provide more info, but I’m pretty sure there’s an issue with event sequence

So in my manifest I have

"loadEvent": "startup"

And it works just fine - plugin loads without any interaction.
Then I have a listener of open event and it also works just fine if I open (or re-open) document when App (Ps) is already launched.

Problem is, when I choose a file on my drive and choose to open it with Ps, while Ps itself is not yet launched:

  • Either open is never fired or more likely plugin is loaded way after open has fired, because plugin never catches that first event when opening App together with a document
  • Can’t test in Dev mode, because can’t load plugin in UDT while App is not launched
  • Can’t test it in stable version, because even if I choose Open with… non-beta .exe, it still opens with Beta 23.4.0 version of Ps

Win 10

I don’t think you can assume anything about event order here – rather you’ll need to handle both cases. You could try checking for any documents that are already open when your plugin starts, and run the same logic as you’d do when receiving the open event.

1 Like

Looks like it’s working and seems reasonable. Thank you