Thread View: adobe.scripting.indesign
9 messages
9 total messages
Started by jay_fresno
Thu, 05 Feb 2009 04:38
Print notes from InDesign CS4
Author: jay_fresno
Date: Thu, 05 Feb 2009 04:38
Date: Thu, 05 Feb 2009 04:38
1 lines
844 bytes
844 bytes
I just upgraded to InDesign CS4 and was hoping that Adobe would have added a feature to print the notes from an InDesign file, but haven't seen any such thing. Does anyone know of a script that would allow InDesign to print notes?
Re: Print notes from InDesign CS4
Author: Peter Kahrel
Date: Thu, 05 Feb 2009 13:17
Date: Thu, 05 Feb 2009 13:17
12 lines
917 bytes
917 bytes
This one places the contents of all notes in a new document:
n = app.activeDocument.stories.everyItem().notes.everyItem().texts[0].contents;
tf = app.documents.add ().textFrames.add
({geometricBounds: ['10mm','10pt','250mm','200mm']});
tf.contents = n.join ('\r\r')
Peter
Re: Print notes from InDesign CS4
Author: jay_fresno
Date: Thu, 05 Feb 2009 15:34
Date: Thu, 05 Feb 2009 15:34
3 lines
712 bytes
712 bytes
Peter, Thank you for this! Your script works great. I feel like you are a genie who granted my wish.
Re: Print notes from InDesign CS4
Author: jay_fresno
Date: Fri, 06 Feb 2009 04:22
Date: Fri, 06 Feb 2009 04:22
5 lines
842 bytes
842 bytes
Peter, Is it possible to add a page number to the note to help identify the note? (By the way, I bought a copy of your book: GREP in InDesign CS3. It's very clearly written. Hope to get some time soon to dedicate to reading it more thoroughly.)
Re: Print notes from InDesign CS4
Author: Peter Kahrel
Date: Fri, 06 Feb 2009 11:23
Date: Fri, 06 Feb 2009 11:23
31 lines
1442 bytes
1442 bytes
Here you go. It finds notes in tables as well. It ignores notes in inline frames.
Peter
(Glad you like the GREP title. There's a CS4 version, by the way.)
#target indesign;
array = [];
notes = [];
// notes in main stories
notes = app.activeDocument.
stories.everyItem().
notes.everyItem().getElements();
// notes in tables
try {notes = notes.concat (app.activeDocument.
stories.everyItem().
tables.everyItem().
notes.everyItem().getElements())} catch (_){};
for (i = 0; i < notes.length; i++)
try {array.push (notes[i].texts[0].contents +
' [' + notes[i].storyOffset.parentTextFrames[0].parent.name +']')} catch (_){};
tf = app.documents.add ().textFrames.add
({geometricBounds: ['10mm','10mm','250mm','200mm']});
tf.contents = array.join ('\r\r')
Re: Print notes from InDesign CS4
Author: jay_fresno
Date: Sat, 07 Feb 2009 03:35
Date: Sat, 07 Feb 2009 03:35
5 lines
733 bytes
733 bytes
Peter, Thank you for adding the page numbers -- works perfectly! Regarding your book, are there many changes in GREP from InDesign CS3 to version CS4?
Re: Print notes from InDesign CS4
Author: Peter Kahrel
Date: Sat, 07 Feb 2009 10:05
Date: Sat, 07 Feb 2009 10:05
11 lines
2037 bytes
2037 bytes
Jay,
Some passages were rephrased to make them clearer. For instance, the difference between lazy operators and negative classes could do with some clarification. I also added some examples here and there, and described a new feature in CS4, GREP styles. Finally, I added a short section on how you can chain saved queries using very simple scripts. I didn't know that one when I wrote the CS3 edition -- jongware spotted it and mentioned it in this forum a while ago.
Something that didn't make it into the CS4 edition is that CS4 supports Unicode properties and sub-properties (of the form \p{..}, see Friedl, "Mastering Regurlar Expressions", pp. 122, 123). For example, there is a property \p{P} that matches punctuation. This one has several subproperties (\p{Pd} matches all kinds of dashes, \p{Po} captures opening punctuation, there are several others). All in all there are 37 Unicode properties.
They didn't make it into the CS4 edition because Adobe is sometimes a bit shy about telling us what new features they implement -- Unicode properties was one of them. I tried these in CS3, but forgot to do that in CS4. A correspondent in France pointed it out to me.
I've now put together an overview of these new properties at <http://www.kahrel.plus.com/indesign/grep_mapper.html> There's a script there that generates selected Unicode ranges and lets you map any GREP wildcard on the selected range.
Peter
Re: Print notes from InDesign CS4
Author: jay_fresno
Date: Sat, 07 Feb 2009 16:01
Date: Sat, 07 Feb 2009 16:01
5 lines
911 bytes
911 bytes
Peter, Thank you for your thorough explanation and comparison of your GREP in InDesign CS3 and CS4 books. I'm going to download the CS4 version this afternoon. I've recommended your book to a number of InDesign users. It's a great way for both 'techies' and 'non-techies' to get a handle on taking advantage of GREP in InDesign.
Re: Print notes from InDesign CS4
Author: Peter Kahrel
Date: Sat, 07 Feb 2009 22:31
Date: Sat, 07 Feb 2009 22:31
1 lines
602 bytes
602 bytes
Thanks, Jay.
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