Copy link to clipboard
Copied
Hey Folks,
I am using a app.scheduleTask as an interval to look if the contents of a folder have changed in the background.
This works well enough but if the user opens up an internal modal dialog (e.g. compositions settings), AE throws an error:

I have not been able to find any system event or variable to check if AE is currently busy with a modal dialog.
At the moment the user needs to restart the complete script, since the error stops the script from further execution.
Is there any option to check for modal dialogs?
Otherwise app.scheduleTask is pretty flawed as it causes every script to break if the user enters a modal dialog.
Cheers,
Matthias
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi,
thanks for the quick reply.
Sadly, adding a try and catch around the app.schedule code didn't do the trick.
app.scheduleTask('try{ check(); }catch(e){}',2000,true);
This will still stop the script from execution and result in the same error message.
The flash timer thingy is a nice idea but I need AECC support.
Cheers,
Matthias
Copy link to clipboard
Copied
Has anyone been able to find a solution to this? Problem still persists in CC.
Copy link to clipboard
Copied
No, you are wrong - the whole script won't even start as soon as there is some Modal Dialog thus your code would not be executed: "Can not run a script while a modal dialog is waiting for response"
Copy link to clipboard
Copied
Same problem here, when using app.scheduleTask() .
By only using app.scheduleTask('anEmptyFunction()', 200, true); with `function anEmptyFunction() { }`, It happens that I get that error if I do open some other projects.
Is it possible to get the error message of an hidden internal modal ?
Copy link to clipboard
Copied
You can use
app.isUISuppressed
to check whether there is a dialog active,
Copy link to clipboard
Copied
But according to http://docs.aenhancers.com/ there is no such option for app object?
Anyway, it works as long it is FALSE, but once it should be TRUE nothing happens because of...the exact problem it was testing against: "Can not run a script while a modal dialog is waiting for response" LOL, so no use I would say cos the script is simply never fired up once it is TRUE thus it has no way to check it.
I did try it this way (dos not work, of course: once TRUE it breaks the code so it does not even get to this statement):
var checkTask = app.scheduleTask("if(!app.isUISuppressed){check();}", 5000, true);
Copy link to clipboard
Copied
Well, I think solution to this Modal Dialog thing cannot be solved via script as any script is immediately terminated as soon as there is some Modal Dialog issue (ehm, talking/meaning specifically "perpetual" app.scheduleTask() which becomes automatically broken this way that is it won't continue once Modal Dialog issue is gone)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now