Copy link to clipboard
Copied
Is there any way to extract shapes used in an EPS file within an InDesign document using scripting without needing to parse the EPS file? I need to convert thousands of InDesign files into another format and the format needs to include the vector shapes that are in the EPS file. If this can't be done in InDesign directly, is there a way to have the script open illustrator from InDesign and use illustrator to extract the shapes?
Copy link to clipboard
Copied
I doubt if this can be done in InDesign without parsing the file, however i would suggest you to take a look at BridgeTalk that is used for communication between Adobe applications. One of the threads that i found interesting and could help you is mentioned below, have a look
How to get result from BridgeTalk message?
-Manan
Copy link to clipboard
Copied
Hi Dean,
what app generated the EPS files?
Does any of the EPS files contain live text?
FWIW:
1. Complex shapes cannot be copied over from Illustrator to InDesign.
2. If the EPS files contain a mix of color spaces color conversion must take place if you are able to open the files in Illustrator.
Illustrator can only do one color space at one time.
Regards,
Uwe
Copy link to clipboard
Copied
The EPS files were generated in illustrator and they do not contain text. The EPS files are CMYK colorspace.
Copy link to clipboard
Copied
Dean, you didn't mention the platform you are on. If you are using a Mac, you could try this applescript:
display dialog "Select 1 vector link to have matching art pasted."
tell application "Adobe InDesign CC 2018"
tell active document
set linkPath to (file path of item link of all graphics of selection)
set geoBounds to geometric bounds of selection
set avgXpos to ((item 4 of geoBounds) + (item 2 of geoBounds)) * 0.5
set avgYpos to ((item 3 of geoBounds) + (item 1 of geoBounds)) * 0.5
set objAG to all graphics of selection
select objAG
set horScale to horizontal scale of selection
set verScale to vertical scale of selection
end tell
end tell
tell application "Adobe Illustrator"
set user interaction level to never interact
open linkPath
set selection to every page item of document 1
copy
tell document 1
close without saving
end tell
set user interaction level to interact with all
end tell
tell application "Adobe InDesign CC 2018"
activate
paste
set vectorArt to selection
set artID to id of selection
set scaleMatrix to make transformation matrix with properties {horizontal scale factorhorScale / 100), vertical scale factor
verScale / 100)}
transform vectorArt in pasteboard coordinates from center anchor with matrix scaleMatrix
set geoBounds2 to geometric bounds of selection
move vectorArt to {avgXpos, avgYpos}
move vectorArt by {(-((item 4 of geoBounds2) - (item 2 of geoBounds2)) * 0.5), (-((item 3 of geoBounds2) - (item 1 of geoBounds2)) * 0.5)}
end tell
(The frowny faces are supposed to be forward slashes, meaning "divided by")
Find more inspiration, events, and resources on the new Adobe Community
Explore Now