/**
* @@@BUILDINFO@@@ OpenPlacedPDFWithAdobeIllustrator-SELECTED-GRAPHIC-FRAME.jsx !Version! Tue Sep 04 2018 02:48:33 GMT+0200
*/
/*
Script for InDesign by Uwe Laubender
Select a graphic frame with a placed PDF.
The script tries to open all pages of the placed PDF with Adobe Illustrator.
Tested with InDesign CC 2018.1 and Illustrator CC 2018 installed on Windows 10.
Code posted at:
Script to edit AI on page in ID into AI?
Michael Witherell Sep 4, 2018
https://forums.adobe.com/message/10598534#10598534
*/
( function()
{
if( app.documents.length == 0 ){ return };
if( app.selection.length != 1 ){ return };
if( app.selection[0].hasOwnProperty("baselineShift") ){ return };
if( app.selection[0].allGraphics.length == 0 ){ return };
var link = app.selection[0].allGraphics[0].itemLink ;
if( link.linkType == "Adobe Portable Document Format (PDF)" && link.name.match(/\.pdf$/i) )
{
var file = link.filePath ;
if(!File(file).exists){ alert("ERROR: Cannot find file!" ); return };
}else{ return };
var bt = new BridgeTalk;
bt.target = "illustrator";
var aiScript = 'var oldInteractionLevel = app.userInteractionLevel;\n';
aiScript += 'app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;\n';
aiScript += 'app.preferences.PDFFileOptions.pageRangeToOpen = "all";\n';
aiScript += 'app.preferences.PDFFileOptions.pDFCropToBox = PDFBoxType.PDFMEDIABOX;\n';
aiScript += 'app.preferences.PDFFileOptions.placeAsLinks = false;\n';
aiScript += 'app.open(File(\"' + file + '\"));\n';
aiScript += 'app.userInteractionLevel = oldInteractionLevel;\n';
bt.body = aiScript ;
bt.send( 30 );
}() )
It will open all pages of the placed PDF with Illustrator. You will not be notified on missing fonts. You will not be asked anything. I changed the user interaction level of Illustrator to "Do Not Display Alerts". The original level is restored after opening the PDF.
You could give the script a keyboard shortcut.