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

Check for Inline object

Participant ,
Nov 18, 2010 Nov 18, 2010

Hi experts

I am trying to match inline object in the paragraph, below is my screen

pic1.JPG

How i can match the inline object every character gives

---------------------------
Script Alert
---------------------------
[object Character]
---------------------------
OK  
---------------------------

how can i find object in the character?

thanks in advance

regards

a r u l

TOPICS
Scripting
710
Translate
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

LEGEND , Nov 18, 2010 Nov 18, 2010

paragraph.pageItems gives you a collection of all anchored/inline objects in a paragraph. Loop through them to find the one you need.

Harbs

Translate
LEGEND ,
Nov 18, 2010 Nov 18, 2010

paragraph.pageItems gives you a collection of all anchored/inline objects in a paragraph. Loop through them to find the one you need.

Harbs

Translate
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
Advisor ,
Nov 18, 2010 Nov 18, 2010

Hey!

This will collect all Inline objects:

var myDoc = app.activeDocument;
var myItems = app.activeDocument.allPageItems;
var foundObjects = Array();

for(var i = 0; i < myItems.length; i++){
    if(myItems.parent instanceof Character){foundObjects.push(myItems);}
}

Hope that helps.

--

tomaxxi

http://indisnip.wordpress.com/

Translate
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
LEGEND ,
Nov 19, 2010 Nov 19, 2010

If you want all inlines in the doc, this is the quickest way to get it in an array:

app.documents[0].stories.everyItem().pageItems.everyItem().getElements();

Harbs

Translate
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
Participant ,
Nov 19, 2010 Nov 19, 2010

Hi Harbs and Marijan Tompa

thanks a lot for your msgs.

Translate
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
Advisor ,
Nov 19, 2010 Nov 19, 2010
LATEST

Yes Harbs. I messed it up!

Still learning

--

tomaxxi

Translate
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