🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by erkki_pennanen Thu, 26 Feb 2009 13:20
JS how to get whole content of paragraph of found text (CS4)
#947
Author: erkki_pennanen
Date: Thu, 26 Feb 2009 13:20
23 lines
1292 bytes
Hi,

Can you tell how to get the content of whole paragraph of found text? I�ll get the content of whole story. How to define paragraph?

// Sample data in InDesign
// A100 (tab) 1234 (tab) 5678 (ret)
// B100 (tab) 1234 (tab) 5678 (ret)
// C100 (tab) 1234 (tab) 5678 (ret)

app.findTextPreferences = null;
app.findTextPreferences.findWhat = "B100";
myFound = app.activeDocument.findText();

myFound[0].select();
myFoundText = app.selection[0].contents // shows content of selected item
alert ("selection is: " + myFoundText)

myFoundText = app.selection[0].parent.contents // shows content of whole story, but only the content of parapgraph of found item?
alert ("content is: " + myFoundText)

regards

Erkki
Re: JS how to get whole content of paragraph of found text (CS4)
#848
Author: Peter Kahrel
Date: Thu, 26 Feb 2009 14:25
3 lines
695 bytes
myFound[0].paragraphs[0].contents

Peter
Re: JS how to get whole content of paragraph of found text (CS4)
#849
Author: erkki_pennanen
Date: Thu, 26 Feb 2009 15:47
7 lines
676 bytes
Peter,

You made it. Thank you very much!

regards

Erkki
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads