Copy link to clipboard
Copied
I have a book that consists of 10 different files and many many different text boxes. I need to find out what the total word count is for the entire book. Is there a simple way to do this, or do I have to copy and paste all the text from InD into a word file to get the number? Your help is much appreciated.
Copy link to clipboard
Copied
A find and replace is your friend
Grep Find
([[:alnum:]]+)
Change to
$1
When you hit Change All you will get a "x amount of changes made", which is total amount of words and numbers (like 2010 and 50,000 etc.)
But that won't count symbols, like punctuation or €,$,£," etc.
To do that you need something like
Find
([[:alnum:]]+)|([,.;:'@#~!"£$%^&*()-+])
Change to:
$0
Then hit change all
Alternatively you could use just
([[:alnum:]]+)|([[:punct:]]+)
Change to
$0
To find all the numbers and text and punctuation in the document
the $0 will replace any found text, found text is represented by items in parenthesis.
Copy link to clipboard
Copied
Hey thanks, Eugene! This helped quite a bit in a project we had. I usually just did a Find/Change on each story and added them up, but this was a time-saver.
THANK YOU!
-Mikey
Copy link to clipboard
Copied
HeyMikey,
No problem.
Copy link to clipboard
Copied
Hi Eugene, using the GREP is very interesting indeed. Thanks for you post!
Anyhow i might be using not right. Here is the situation. I made a couple of different sections of the magazine. Each section is separated from the other because i would like to have a word count of the News sections for example. Let's say News Section, 3 pages with connected text boxes. I applied
Alternatively you could use just
([[:alnum:]]+)|([[:punct:]]+)
Change to
$0
and obtained ok results. But later on for specific word counts
([[:alnum:]]+)
Change to
$1
I did gave me the whole words of the complete document. Is there anyway i could count just word (not punctuation characters) of an specific parragraph. I keep getting the whole word count of the magazine. I might applying the GREP wrongly, of course. Here is the idea.
http://www.pixentral.com/show.php?picture=16isbwm5k44gUfexJY0dJxG92GXrdH
Thanks for any info!
S
Copy link to clipboard
Copied
Change the focus of the search from the entire document to the current story.
Copy link to clipboard
Copied
You may also try using the "Info" tab. If your whole story is linked within one text string, you can highlight all the text, click on this tab, and it will list the number of characters, words, lines and paragraphs. Similarly, if you need the word count for just one paragraph, highlight that paragraph and look at the Info Tab.
Copy link to clipboard
Copied
This AppleScript will get the total word counts of a folder of ID files—it shouldn't be too hard to convert to JavaScript if you are not using OSX:
tell application "Finder"
activate
set myFolder to choose folder with prompt "Select the folder containing the files to count"
set myFiles to every file of folder myFolder whose file type is "IDd5"
end tell
tell application "Adobe InDesign CS3"
set wordcounts to {}
set total to 0
repeat with j from 1 to (number of items in myFiles)
open item j of myFiles
tell active document
tell every story
set wordcounts to wordcounts & (count every word)
end tell
set totalstories to count every item of wordcounts
repeat with i from 1 to totalstories
set total to total + (item i of wordcounts)
end repeat
close
end tell
end repeat
display dialog "The documents in the selected folder have a total of " & totalstories & " stories, and " & total & " words"
end tell
========================================
If you just want the active document's count it would be:
tell application "Adobe InDesign CS3"
tell active document
set wordcounts to {}
tell every story
set wordcounts to wordcounts & (count every word)
end tell
set total to 0
set totalstories to count every item of wordcounts
repeat with i from 1 to totalstories
set total to total + (item i of wordcounts)
end repeat
display dialog "Total words in all " & totalstories & " stories: " & total
end tell
end tell
Copy link to clipboard
Copied
Hi guys, thanks for the fast and good replies! I will try them now to check how that works.
Rob, when you say script (i am kind of newbie with those) a should copy and paste the text and paste it Text Edit? A text edit doc, maybe with the extension changed is already a Javascript?
Cheers,
Copy link to clipboard
Copied
The scripts are AppleScript so you would need to be on a Mac to use them.
Here they are compiled, just open the .zip archive below and put the two files in your scripts folder (Applications/Adobe InDesign/Scripts/Scripts Panel)
http://www.zenodesign.com/scripts/wordcount.zip
If you are not on a Mac you could try posting in the Scripting forum and see if someone will translate them to JavaScript for you.
Copy link to clipboard
Copied
sorry double post
Copy link to clipboard
Copied
This works except for if there is a table in the InDesign file. I ran a file through the script and got a word count of 25. Converting to a PDF and getting the word count, it was 17,112!
Copy link to clipboard
Copied
Quick way is to use find/change. Find a space, change it to a space.
ID will tell you how many changes were made. Not an exact science but it's close. Other than that, the info panel shows word count by story.
Bob
Copy link to clipboard
Copied
Find space finds about 5700 in my current document.
The change find by GREP I posted finds c.6,100 for just the alnum sequence and c.6,900 for the punctuation included.
Copy link to clipboard
Copied
Okay I am going to give that a try. Thank you!
Copy link to clipboard
Copied
I did say it wasn't an exact science.
Bob
Copy link to clipboard
Copied
https://forums.adobe.com/people/Eugene+Tyson wrote
Find space finds about 5700 in my current document.
The change find by GREP I posted finds c.6,100 for just the alnum sequence and c.6,900 for the punctuation included.
Sounds like you have about 400 paragraphs in your book.
Copy link to clipboard
Copied
Whoa that is clever and simple.
Copy link to clipboard
Copied
It works! Thank you!
Copy link to clipboard
Copied
rdmz wrote:
I have a book that consists of 10 different files and many many different text boxes. I need to find out what the total word count is for the entire book. Is there a simple way to do this, or do I have to copy and paste all the text from InD into a word file to get the number? Your help is much appreciated.
I seem to remember that there's a script or a plug-in that can do this, but it may be limited to one file at a time. Perhaps someone on the forum has a better memory than mine. Google finds links to scripts for "indesign export story script" (without quotes), but not for whole documents.
The differences between the find/replace methods mentioned in this thread may relate to whether or not text in master-page text, and paragraph auto-numbers and bullets are counted or ignored.
There's a button in the Find dialog box to ignore master-page text like headers, footers, and page numbers. To count auto-numbers and bullets, replace them with text. NOTE: Save a copy of the document set, and perform the replacement on the copy.
HTH
Regards,
Peter
_______________________
Peter Gold
KnowHow ProServices
Copy link to clipboard
Copied
Hello,
You could try this regex : \S+ in all documents. But \S include punctuation.
But you can use this Loic Aigon's script, Words count : http://www.loicaigon.com/fr/auto.php?file=words_count.jsx
Copy link to clipboard
Copied
peter at knowhowpro wrote:
The differences between the find/replace methods mentioned in this thread may relate to whether or not text in master-page text, and paragraph auto-numbers and bullets are counted or ignored.
Another place you'd find differences creeping in would be that stories don't usually start or end with a space, which would have the effect of reducing the word count by 1 for every story. Nor, I think are tabs likely to be counted if you have a lot of tabular sorts of content.
Copy link to clipboard
Copied
I ended up copying the text from the PDF I created from the InDesign and pasted it in a Word document. This method does count the content that is on the master pages and does not account for hyphenated words, but I just went through and fixed or deleted items where need be. Thank you for all the help!
Copy link to clipboard
Copied
You can export the pages you want to count to pdf. Then open this pdf in Word. Word will the open the file and convert it. Word then shows the word count.