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

Missing Font workaround for JavaScripting

New Here ,
Mar 15, 2011 Mar 15, 2011

Hello, I am automating an Illustrator workflow. I receive customer files and regularly have to substitute in missing fonts. The problem is that when a font is missing I get that dialog box instantly and would like a way to close it and continue on with the script. I will deal with the missing fonts later when the script is finished.

I'm using the ESTK with JavaScripting and the solution should be compatible with a Mac & a PC.

So my question is, is there a way to disable this missing fonts message or a way to simulate clicking the 'Done' button through a script? Or possibly some other solution I'm not thinking of...?

Thanks in advance for you help!

TOPICS
Scripting
2.0K
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
Adobe
Community Expert ,
Mar 15, 2011 Mar 15, 2011

I get the missing font dialog when I open the file from the GUI. When I open it from the script it just opens, no dialog.

var file = new File("yourFullPathFile");

var idoc = app.open(file);

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
Guide ,
Mar 16, 2011 Mar 16, 2011

Have you also tried changing the app properties first…

app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS; app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

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
New Here ,
Jul 05, 2011 Jul 05, 2011

Hello all,

I have the same problem.

I have tried the "DisplayAlert" solution without succes.

Do you have find the solution ?

Thank for your help.

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
New Here ,
Jul 05, 2011 Jul 05, 2011

After one day looking for a solution on the web, I'm so disapointed...

Is it possible that there is no issue ?

What do you think about validate the "Missing Font" dialog box by simulate the "enter" key ?

And how to achieve this action with JavaScript ?

Thank you.

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 Expert ,
Jul 05, 2011 Jul 05, 2011

I don't get the dialog, can you post your script here?

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
New Here ,
Jul 05, 2011 Jul 05, 2011

Hello,

That is my script :

#target illustrator var defaultFolder = new Folder(); var inputFolder = defaultFolder.selectDlg ('Sélectionnes un dossier source...') var saveFolder = defaultFolder.selectDlg('Sélectionnes un dossier de destination...'); var fileList = inputFolder.getFiles(/\.(ai|eps|pdf)$/i); for ( i = 0; i < fileList.length; i++) { if (fileList instanceof File) { open(fileList); app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; var doc = app.activeDocument; originalName = doc.name.substr(0,doc.name.length-3); layerCount = doc.layers.length; for (var ii = layerCount - 1; ii >= 0; ii-- ) { targetLayer = doc.layers[ii]; if ( targetLayer.visible == false) { doc.layers[ii].visible = true; } if ( targetLayer.locked == true) { doc.layers[ii].locked = false; } }      for ( iii = 0; iii < doc.groupItems.length; iii++ ) { elemt = doc.groupItems[iii]; groupName = new String( elemt.name ) ; if ( groupName.indexOf ("PdG") == 0) { elemt.selected = true; var newItem; var docPreset = new DocumentPreset ; docPreset.title = originalName+'V'+[iii]; var newDoc = app.documents.addDocument (DocumentColorSpace.CMYK, docPreset) ; elemt.selected = false; newItem = elemt.duplicate( newDoc, ElementPlacement.PLACEATEND ); doc2=app.activeDocument;    var myVisibleBounds = doc2.pageItems[0].visibleBounds; doc2.artboards[0].artboardRect = myVisibleBounds; var exportOptions = new ExportOptionsJPEG(); var type = ExportType.JPEG; var fileSpec = new File(saveFolder); exportOptions.antiAliasing = true; exportOptions.qualitySetting = 70; app.activeDocument.exportFile( fileSpec, type, exportOptions ); app.activeDocument.close( SaveOptions.DONOTSAVECHANGES ); } } app.activeDocument.close( SaveOptions.DONOTSAVECHANGES ); } }

Thanks for your help.

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 Expert ,
Jul 06, 2011 Jul 06, 2011

I still don't get the Missing Font dialog using your code, I have CS4, CS5 on Windows.

is it this Dialog we're talking about?,

missingFont.PNG

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
New Here ,
Jul 06, 2011 Jul 06, 2011

It looks like refering to the same problem but here is my dialog box, on Mac OS 10.6 and CS4 in french !

DialogBoxMissingFont.png

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 Expert ,
Jul 06, 2011 Jul 06, 2011

sorry, I can't further test on mac, I don't own one.

the only thing I see is to move

app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

before opening the documents in you code. Let me know.

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
New Here ,
Jul 08, 2011 Jul 08, 2011

I have already tried but without succes.

Do you know if I can simulate the Enter key, with java script, in order to validate the highlighted button of the dialog box ?
Thanks.

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
Guru ,
Jul 08, 2011 Jul 08, 2011
LATEST

You can't with JavaScript you would need to do that outside of the app at a system level… AppleScript could do this… I've done it before with Photoshop. I think Adobe have differing classes/types of dialog… Some are dismissible where others aren't…

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