If we talk about fitting options, i see that the frame fitting options applied on the container does hold its value even after replacing the image within the container. The tricky part is that if content is fitted using options other than the one applied on the frame i.e using the options within the context menu obtained on right clicking the frame like for ex: Centre Content. In this case i don't see any property being set on the frame. I doubt this could be done just by using scripting interface.
However if we have a C++ plugin, we could put some observers to look for fitting being done and then add some labels onto the frame with the fitting value which can then be used to reapply the fitting when the image is replaced.
It would be interesting to know the view of other members on this problem.
if there was a before place and after place event you could recored the settings on the before, then re-apply them on the after.
These look interesting.
Property Type Access Description AFTER_PLACE string readonly Dispatched after a Graphic is placed. This event bubbles. This event is not cancelable. (default: afterPlace) BEFORE_PLACE string readonly
Dispatched before a Graphic is placed. This event bubbles. This event is cancelable. (default: beforePlace)
This could work if these events are raised even when the fitting options are changed i.e. not placing and also not changing the frame fitting options but just fitting the image already within the rectangle, that needs to be tested.
Let me stop you right here guys:
There are no fitting options involved. Just placed images, who got e.g. mirrored or inner-x = -0,235 or scaled.
Look at picture below.
But I stumbled upon InDesign not blocked by anything/fully controlable, having an image hanging at my placegun.
So I guess I can forget about events and just fire a script by hand if needed. That makes it a bit easier, also the placegun always holds just one image. What I cant do is to select any object, while something is hanging at the placegun, but a pre-selected image-frame stays selected. A script must take the data from the placegun, and push it in the pre-selected container, keeping the image-attributes.
Is this something that can be done?
…What I cant do is to select any object, while something is hanging at the placegun…
usually you can switch temporarily to the Selection Tool using the Cmd key ( Mac OS X ) when the Placegun is loaded.
In that case you would need to copy over the property values from the original image on to the new image. Something like the following should work, i am copying over the vertical and horizontal scaling in this example
var vScale = app.selection.images.verticalScale var hScale = app.selection.images.horizontalScale var fPath = app.activeDocument.placeGuns.rectangles.graphics.itemLink.filePath //Get the filePath of the first item loaded in the placegun app.selection.place(fPath) app.selection.images.verticalScale = vScale app.selection.images.horizontalScale = hScale
Run the above code with a selected rectangle with an image inside it and an image loaded on the placegun. Let us know if this helps or we are still off direction from what you want.
Thank you Manan Joshi for your time: I guess thats it, works like a charm!
…oh wait! Our Dam uses vault links, which again cant be processed without the interaction of the dam-plugin, which lacks this feature in the first place. All work for the trash, damn DAM. Not the first thing, Canto Cumulus messes up.
And also thanks to UweLaubender, didnt knew that placgun/selection-tool trick