• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to release images anchored in a table cell

Community Beginner ,
Oct 30, 2024 Oct 30, 2024

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: 

            settings.anchoredPosition = AnchorPosition.ANCHORED;
            settings.anchorXoffset = 0;
            settings.anchorYoffset = 0;

Any suggestions on how to appropriately access this property, or alternative approaches, please?

TOPICS
Scripting

Views

142

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2024 Oct 30, 2024

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?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 31, 2024 Oct 31, 2024

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2024 Oct 31, 2024

Copy link to clipboard

Copied

LATEST

@Andrew24943677v30i

 

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. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2024 Oct 31, 2024

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 31, 2024 Oct 31, 2024

Copy link to clipboard

Copied

Thank you for the suggestions, I'll try again today.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines