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

only selected anchored objects

New Here ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

Goodmorning everyone,

having no experience with scripts, I apologize for perhaps stupid questions but I can't do the most trivial things:

to find all the anchored objects I made this script:

var story = app.selection [0] .parentStory;

var anchoredItems = story.pageItems.everyItem (). getElements ();

for (var n = 0; n <anchoredItems.length; n ++) {

........................

......................

};

but I could not understand how to do, if I select only a few lines of text, to find only the anchored objects related to the selection?

Thanks for your help

ivan

TOPICS
Scripting

Views

644

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

correct answers 1 Correct answer

Engaged , Jul 02, 2019 Jul 02, 2019

Votes

Translate

Translate
Engaged ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

Hi Ivan,

Find Anchored objects (reference point& position) script

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

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
New Here ,
Jul 03, 2019 Jul 03, 2019

Copy link to clipboard

Copied

thank you for your suggestion

I also found inspiration for other problems

thank you

regards

ivan

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
Engaged ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

This link is not working. https://forums.adobe.com/message/8635101

Could it be shared as text message?

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 ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

LATEST
// When text is selected:
var anchoredItems = app.selection[0].allPageItems;

Loop the result array.

That will even catch items in selected text that contains a table with graphic cells or anchored items in text cells.

 

Regards,
Uwe Laubender

( ACP )

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