Hello,
I found the thread that contains the Applescript for this, but would love to have a Javascript that works the same. Anyone have or know of one for ID CS5 that will apply all clipping paths for a group of objects at once?
Thanks in advance, as always
Andy
Hmmm ... the reverse of http://indesignsecrets.com/forum/indesign-add-ons-scripts-scripting-an d-plug-ins/release-clipping-masks-on-all-selected-objects ?
(Maybe all you need to change is my None to xxxx, where 'xxxx' is the proper command for 'do'
)
It depends on what your images are. Check the possible values here: http://jongware.mit.edu/idcs5.5js_html/idcs5.5js/pe_ClippingPathType.h tml
For Photoshop images, you can get a list of the names of all paths (see http://jongware.mit.edu/idcs5.5js_html/idcs5.5js/pc_ClippingPathSettin gs.html) and you can select one. Perhaps all you need is the first (and typically, the only) path?
So it's all Photoshop paths? Yes, it ought to work. Perhaps you also need to specify which path ... Try with this line added:
app.selection[i].images[0].clippingPath.appliedPathName = app.selection[i].images[0].clippingPath.photoshopPathNames[0];
inside the try { .. } catch block. This ought to set the clipping path to the very first one in the file.
It's important to do operations such as these inside a try .. catch block, because this construction shields you from errors. Without the try .. catch, the script would issue an error for the very first image it encounters that has zero paths (and thus "the first", which is numbered #0, is not valid) and then stop with the error alert. Now it will still signal the error but the 'error handler' (the second curly-bracketed part) ensures it does nothing with that information, and so it will ignore the error and continue with the next image.
And yes, a Javascript needs to be saved as ".jsx" to work. Otherwise InDesign doesn't recognize it as a valid script.
North America
Europe, Middle East and Africa
Asia Pacific