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

Close modal from extendscript

Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Using extendscript, I am opening a project from the drive.

project = new File(projectPath);
app.open(project);

Here, project is a .aep file, which may/maynot have unresolved font issues and the software presents me with this dialog box.

Screenshot 2019-09-24 at 12.16.55 PM.pngIn case it does, I want to close this modal from the extendscript itself. How can this be done?

TOPICS
Error or problem , How to , Scripting
2.1K
Translate
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
Advocate ,
Sep 24, 2019 Sep 24, 2019

There is no programmatic way to close this window.

However, you can disable Do not warn me about missing fonts when opening projects before opening the project programmatically before opening the project, by modifying AE preferences (not at PC, cannot give you the exact line of code).

Let me know if this helps.

Translate
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
Community Beginner ,
Sep 24, 2019 Sep 24, 2019
Is there any viable way to disable modals and prompts in general? The error prompts?
Translate
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
Advocate ,
Sep 24, 2019 Sep 24, 2019

Yes.

app.beginSuppressDialogs() and

app.endSuppressDialogs()

More info in the docs http://docs.aenhancers.com/general/application/?highlight=beginSuppressDialogs#app-beginsuppressdial...

Translate
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
LEGEND ,
Sep 24, 2019 Sep 24, 2019

You need to query the internal command ID of the dialog button and then execute it.

 

Mylenium

Translate
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
Community Beginner ,
Sep 24, 2019 Sep 24, 2019
Could you shed a little light on the command?
Translate
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
Advocate ,
Sep 24, 2019 Sep 24, 2019
Mylenium, if you are refering to app.executeCommand(commandID) method, then this will not work, as this action does not have an ID.
Translate
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
Advocate ,
Sep 24, 2019 Sep 24, 2019

Here's a snippet to toggle visibility of this dialog. Change warnAboutMissingFonts value as per your needs

(function setMissingFontsDialogVisible() {
	var warnAboutMissingFonts = false;

	var section = 'General Section';
	var key = 'Hide Missing Font Dialog';
	var prefType = PREFType.PREF_Type_MACHINE_INDEPENDENT;

	try {
		app.preferences.savePrefAsBool(section, key, warnAboutMissingFonts, prefType);
		app.preferences.saveToDisk();
		app.preferences.reload();
	} catch (error) {
		alert(error);
	}
})();
Translate
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
Participant ,
Sep 28, 2019 Sep 28, 2019

Hey Tomas,  what about these? I believe they solves missing fonts as well, but don't remember 100%.

 

app.beginSuppressDialogs()
app.endSuppressDialogs()

 

Translate
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
Advocate ,
Sep 28, 2019 Sep 28, 2019
Hey, Tom. No, these methods will have no impact on Missing Font message. Actually beginSuppressDialogs() doesn't really suppress too many dialogs - the only place I saw it working was when I was opening/importing older AEP files into newer AE version. I don't remember it suppressing anything else. But I might be wrong.
Translate
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
Participant ,
Sep 28, 2019 Sep 28, 2019
LATEST

I kind of have a memory from the past. where this KIND OF worked. And in fact, worked in a bit tedious manner.

For example, if suppressDialogs were beginned but code stopped at some point... During new script execution process it forced to 'save' the status of previous project, without a way to overcome it. That was a tedious part in the development 🙂 But probably this could have be tested to make sure at what cases it works indeed.

Translate
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