Reply to topic  [ 6 posts ] 
Need some quick help - need a macro for extracting a list 
Author Message
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2010-11-29 15:43:34
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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 3818 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.


2010-11-29 15:59:25
Profile WWW
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2010-11-29 17:41:05
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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.


2010-11-29 17:57:21
Profile WWW
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2010-11-29 22:09:21
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Happy to help- I'm glad the macro works for you. Thank you for the donation Lou- that's very gracious! :)


2010-11-30 09:55:22
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software