I need a line counter!

Have a problem? A question? This is the place for answers from other Express users.
Post Reply
kavandje
Posts: 2
Joined: 2004-09-24 05:54:59
Location: Windhoek, Namibia

I need a line counter!

Post by kavandje »

I've put in a feature request for the matter, and I've received some feedback, so that's encouraging. But our chief subeditor needs a line counter *now* or she won't switch from ClarisWorks3.0...

So I'm thinking in terms of a simple script/macro: we eyeball each printed page at around 12 words. If it were 10 words, it'd be OK, since that's really easy to do in your head. But the editorial staff don't have their 12-times table in their heads. So what I'd like to do is take the current word count, divide it by 12, and display it in a little window. Is anyone out there AppleScript and/or perl savvy enough to help me out here?
dennisg
Posts: 73
Joined: 2004-05-16 07:51:28
Location: Seattle, WA

Post by dennisg »

This may not be quite the answer you're looking for, but I use Spell Catcher which provides a line count, plus a far better spell checker than the one in NWE.
- Dennis

"Is that your little friend in the wood chipper?"
kavandje
Posts: 2
Joined: 2004-09-24 05:54:59
Location: Windhoek, Namibia

Post by kavandje »

dennisg wrote:This may not be quite the answer you're looking for, but I use Spell Catcher which provides a line count, plus a far better spell checker than the one in NWE.
Thanks; have googled, and it's not quite what I'm after. We're pretty happy with MacOS X's built-in spell-checker, and I want to keep the editorials from having to switch between apps as much as possible. Added complication = bad. *Ideal* would be a line counter next to the word counter, like in Mellel but without Mellel...

As a stop gap I'm soliciting help in writing an AppleScript or a perl script to, well, fill the gap. :-)
rmark
Official Nisus Person
Posts: 428
Joined: 2003-02-11 10:49:05
Location: Solana Beach, CA
Contact:

Post by rmark »

Here's the AppleScript referred to, in case someone else might be interested:

* * * * * * *
tell application "Nisus Writer Express"
set allText to text of document 1
set wordCnt to count of words of allText
set wordCnt to wordCnt / 12
display dialog (wordCnt as string) & " lines." & return & "Calculated as words / 12" buttons {"OK"} default button "OK"
end tell
* * * * * * *



You can do one of two things with the script.

A. Open Script Editor and paste the above lines (the ones between, but not including the asterisks) into a new script window, then save it to NWX's Macro folder ~/Library/Application Support/Nisus Writer/Macros. The 'File Format' popup should say 'Script' and the file extension should be 'scpt'.

Or

B. Paste the script (again, the lines between, but not including the asterisks) into a plain text file and save it to the Macro folder with an extension of 'applescript'. This would run a bit slower than if it was saved as a script.



The script counts the number of words in the document (just the body text, not headers/footers/footnotes) then divides it by twelve and displays the result in a modal dialog box.
Write On!
Mark Hurvitz
Nisus Software Inc.
Post Reply