Thread View: adobe.scripting.indesign
5 messages
5 total messages
Started by huksy
Thu, 02 Apr 2009 07:48
[JS CS3] Getting Document of Grepsearch-Result
Author: huksy
Date: Thu, 02 Apr 2009 07:48
Date: Thu, 02 Apr 2009 07:48
14 lines
1149 bytes
1149 bytes
Hi there,
I'm doing a grep-search about all open documents by script. The results are saved by an array:
myGrepText = app.findGrep(true);
Afterwards I loop all results and I need to know in which document the individual result is. This code works so far:
for (var i = 0; i < myGrepText.length; i++ ) { var myDoc = myGrepText[i].parent.insertionPoints[0].parentStory.parent; ... }
My Question: Isn't there a better way to get the analog document?
Thanks
H.
Re: [JS CS3] Getting Document of Grepsearch-Result
Author: Peter Kahrel
Date: Thu, 02 Apr 2009 08:47
Date: Thu, 02 Apr 2009 08:47
5 lines
774 bytes
774 bytes
myGrepText[i].parentStory.parent; Though ideally you you check if that is indeed a document in order to cope with text found in anchors, overset text, etc. Peter
Re: [JS CS3] Getting Document of Grepsearch-Result
Author: Dave_Saunders
Date: Thu, 02 Apr 2009 12:34
Date: Thu, 02 Apr 2009 12:34
3 lines
726 bytes
726 bytes
Ah, but the parent of a story, overset, anchored or whatever, is always the document. Dave
Re: [JS CS3] Getting Document of Grepsearch-Result
Author: Peter Kahrel
Date: Thu, 02 Apr 2009 13:53
Date: Thu, 02 Apr 2009 13:53
11 lines
853 bytes
853 bytes
Ah, but the parent of a story, overset, anchored or whatever, is always
the document.
All the better -- no need to check then.
Peter
Re: [JS CS3] Getting Document of Grepsearch-Result
Author: huksy
Date: Thu, 02 Apr 2009 15:01
Date: Thu, 02 Apr 2009 15:01
4 lines
621 bytes
621 bytes
I understand! :-) Thanks! H.
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