Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Getting modular scripts to target as expected

$
0
0

Right now I'm working on a script I'm using for an EPUB conversion. Essentially I don't like the quality of the EPUB files which are natively generated. Specifically the bitmap representation of images. As such I am writing a script to convert when possible AI images into SVG images to be placed into the EPUB.

 

My basic flow is as follows:

 

1) Open up a document within InDesign. Grab all of the relevant AI links and save them into a global variable.

2) Open each of the identified image documents in Illustrator and run my export script in illustrator.

 

Somewhere between steps one and two something is going wrong. Below I've inserted the relevant code. I realize this may be an issue illustrator side, but the error is being thrown by the InDesign engine. Why is InDesign handling the file opening? Is there a better way to handle this?

 

Error message throw to ExtendScript:

Cannot open the file "PETS_01962.ai". Adobe InDesign may no support t....format may be missing, or the file may be open in another application.

#target indesign

#targetengine "session"

x = app.doScript("C:\\Program Files (x86)\\Adobe\\Adobe InDesign CS6\\Scripts\\Scripts Panel\\Samples\\JavaScript\\getPaths.jsxbin");

app.doScript("C:\\Program Files (x86)\\Adobe\\Adobe InDesign CS6\\Scripts\\Scripts Panel\\Samples\\JavaScript\\illustrator.jsxbin")

 

 

//getpaths.jsxbin

#target InDesign

getFilePaths()

function getFilePaths(){

...

return filePaths

}

 

 

//  illustrator.jsxbin

#target illustrator

app.open(File(x[0]));

...


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>