nisus.com
https://www.nisus.com/forum/

Need some quick help - need a macro for extracting a list
https://www.nisus.com/forum/viewtopic.php?f=17&t=3999
Page 1 of 1

Author:  loulesko [ 2010-11-29 15:43:34 ]
Post subject:  Need some quick help - need a macro for extracting a list

Hey all,

I've got a book due at the publisher and I've used list style to indicate the illustrations like this:

[ 5 Fig 1 ] Caption of image

Could one of you macro geniuses help me out with a macro to extract the each Fig and place on a separate document. Like I mentioned I'm using a list style at Level 1 if that's any help. Each Fig id on its own line as well.

Many, many thanks
Lou

Author:  martin [ 2010-11-29 15:59:25 ]
Post subject:  Re: Need some quick help - need a macro for extracting a li

Hi Lou. This won't be too much of a problem, but let's clarify what you've got in your document exactly. As an example, does your document look something like this:
Attachment:
Picture 2.png
Picture 2.png [ 12.66 KiB | Viewed 3822 times ]

I turned on show invisibles so you can see the newlines. Also the automatically generated list item/number is highlighted in light green.

Does that look like what you've got? If not, perhaps you can take a screenshot of one of your images and its caption. Thanks.

Author:  loulesko [ 2010-11-29 17:41:05 ]
Post subject:  Re: Need some quick help - need a macro for extracting a li

Martin,

That's it exactly. Except there is no image. Just the text. But your format assumption is dead on.

The images are being added by the publisher once we corral them together, which is what we need the Fig list for.

Thank you so much.

Lou

Author:  martin [ 2010-11-29 17:57:21 ]
Post subject:  Re: Need some quick help - need a macro for extracting a li

Ah, okay, all is understood, thanks. Give the following macro a try:
Code:
Find All '\[\d+ Fig \d+\]\t.*\n', 'E'
Copy Text Only
New
Draft View
Paste

When you run it on the frontmost document it should make a new document listing all image numbers and captions. Let me know if it gives you any troubles or wasn't what you were after.

Author:  loulesko [ 2010-11-29 22:09:21 ]
Post subject:  Re: Need some quick help - need a macro for extracting a li

It worked fabulously. Exactly what I needed to get me back on schedule.

As a thank you I made a donation in Nisus' honor to "Reading is Fundamental", a charity that helps challenged children with literacy. Basically it's investing in the next generation of writers.

http://www.rif.org/us/about-rif.htm

Thank you so much for your help.

Lou

Author:  martin [ 2010-11-30 09:55:22 ]
Post subject:  Re: Need some quick help - need a macro for extracting a li

Happy to help- I'm glad the macro works for you. Thank you for the donation Lou- that's very gracious! :)

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/