I get these errors: Error: host is in a modal state
…when you ask PS it says we are not in modal state. But when you run a command it says could not run because we are in modal state. This happens e.g. when I open dialog File → Open so you look at file picker dialog and then some event triggers executeAsModal
This must be a bug because require("photoshop").core.isModal()
returns false
when you have file picker dialog opened but should return true