Copy link to clipboard
Copied
I am writing a script that is intended to assign an objectStyle to images, which have been placed from Word files and are anchored within table cells. I want to first 'extract' the images from the cells by releasing the anchor.
This stand by doesn't seem to have any effect in this case: Solved: How break with script to anchored object release - Adobe Community - 6650519—unless I manually change the anchor properties to custom (versus Inline or Above Line), the reference script will work. I haven't been able to change this property via script, as in, for example:
Any suggestions on how to appropriately access this property, or alternative approaches, please?
Copy link to clipboard
Copied
Do you want to just remove image from table cell and have it somewhere on the page / spread or in the same location?
Copy link to clipboard
Copied
This approach could work. I see that the duplicate() command is greyed out when doing it manually, so I might assume that is not available to me in this case. Are you proposing use of the clipboard or some other means?
Copy link to clipboard
Copied
Yes, Cut, select nothing, paste.
It might not be the most elegant solution - but depends on what you want to achieve - might be the most efficient - you can paste then move to a desired position - create a "gallery" on a page - or paste into a new Story, etc.
Any chance you would be interested in a paid solution - no coding experience needed and you can automate a lot more? As long as you work on a PC.
Copy link to clipboard
Copied
Hi @Andrew24943677v30i ,
to access anchored objects inside a text cell you first have to loop the page items in the text of a cell.
To gather them for a single text cell:
var anchoredItemsArray = cell.texts[0].pageItems.everyItem().getElements();
Now loop the array, change the anchor position and release the anchored object:
for( var n=0; n<anchoredItemsArray.length; n++ )
{
anchoredItemsArray[n].anchoredObjectSettings.anchoredPosition = AnchorPosition.ANCHORED;
anchoredItemsArray[n].anchoredObjectSettings.releaseAnchoredObject();
};
Note: you could be in trouble if the anchored object is part of overset text.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Thank you for the suggestions, I'll try again today.