InDesign: Batch apply clipping paths -- not working

Hi. Constantly creating the same document with new content. Datamerge is great, but it won’t apply the clipping path to my images. Trying to run through the images and turn the path on with applescript. I’m an on-again-off-again programmer, but scripting InDesign is new to me. Could someone please point out the problem?

Oh, and the result I get with this script is weird. I don’t “see” any change to the images but the Object > Clipping Path… menu shows that I have correctly (?) set the the clipping path type to “photoshop path” and the path name is also correctly (?) reflected in the pulldown field. (FYI: the path name of all the images I’m working with is “silo”). So the settings look properly set by the script, but no visual change. Still no change if I toggle the preview option, but selecting ‘type: none’ and then back to ‘type: photoshop path’ changes the image visual to what you’d expect – and what I want the script to do.

Ok, enough whining, here’s the code:


tell application "Adobe InDesign CS2"
	
	set myDoc to active document
	
	tell myDoc
		
		set theLinks to every link
		
		repeat with i from 1 to count of theLinks
			
			set targetImage to parent of item i of theLinks
			
			set clipping type of clipping path of targetImage to photoshop path
			set applied path name of clipping path of targetImage to ((item 1 of photoshop path names of clipping path of targetImage) as string)
			
		end repeat
		
	end tell
	
end tell

Thanks to anyone kind enough to help!

Hi,
this is an InDesign bug…

Greets from
TMA

Thanks, TMA.

Is there a workaround – like if I use JavaScript, instead? Is this bug fixed in CS3?

Hi,
i dont try it with javascript. maybe its the same problem. and its not fixed in CS3.

Greets from
TMA