Script to edit PDF on page in ID into AI?
Is there a scriptable way to Option-Double-Click (Edit Original) a vector AI graphic and have it load into Illustrator; not Acrobat?
Is there a scriptable way to Option-Double-Click (Edit Original) a vector AI graphic and have it load into Illustrator; not Acrobat?
Both are the latest CC 2018 versions.
Hi Michael,
do you want to open all pages of a placed PDF with Illustrator CC 2018?
If yes, try the ExtendScript ( JavaScript ) code below:
/**
* @@@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
*/
( 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 );
}() )
Important: Before running the script select the graphic frame that is holding the placed PDF.
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 might know this:
The opened PDF file will open as unnamed in Illustrator.
You could give the script a keyboard shortcut.
Regards,
Uwe
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.