Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
Have you also tried changing the app properties first…
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS; app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I don't get the dialog, can you post your script here?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?,
Copy link to clipboard
Copied
It looks like refering to the same problem but here is my dialog box, on Mac OS 10.6 and CS4 in french !
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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…