5921 Views 10 Replies Latest reply: Oct 7, 2009 2:56 AM by ElleW
Well, I didn't mean to imply Apple script is primitive, and maybe I'll go and figure a keen script again, the primitive aspect is no choice using an assigned keystroke and selection choice panel that provides the number of words. Blam. Sorta like typing tangent 22 degrees in google. Hit return. Blam. El numero.
My mistake. I thought that you whipped up some bash script and was not aware you were referring to the above AppleScript. I'm trying to figure, with a wild card, how you get a word count and list of say, all .txt, .rtf and .pdf in Documents and write to a designated file.
wc -w /Users/dougp/Desktop/"ssh and sftp commands.txt" > /Users/dougp/Desktop/wordcounter.txt
This does such but it's just a basic wc on only one file. I tried variations with
doug-penningtons-power-mac-g4:Documents dougp$ wc -w /Users/dougp/Documents/[.txt]* > /Users/dougp/Desktop/wordcounter.txt
But that one with wildcard only pulls up one random .txt file out of many and writes it off as desired. What's wrong here aside from posting to Unix Discussion?
This works but I still can't figure how to add to command to list and word count sub directories in Documents.
doug-penningtons-power-mac-g4:Documents dougp$ wc -w /Users/dougp/Documents/*.txt *.rtf *.pdf > /Users/dougp/Desktop/wordcounter.txt
which shows this result to write out file:
107 /Users/dougp/Documents/How Leopard is installed(not .pkg's).txt
347 /Users/dougp/Documents/Windows Dig copy 2.txt
143 /Users/dougp/Documents/launchagent info.txt
465 /Users/dougp/Documents/start & stop mysql & phpmyadmin.txt
26 /Users/dougp/Documents/template for appdisc posted images from myserver.txt
260 Phone Book copy.rtf
9366 About Stacks.pdf
27815 Peachpit_ The Mac Sys Admin's Guide to Assessing Systems in Mac OS X 10.5 > Evaluating the Upgrade History.pdf
17581 QUICKLY empty the trash by rsync.pdf
1943 mount nfs leopard exports to panther.pdf
Thanks. Plus I am going to post this to http://discussions.apple.com/forum.jspa?forumID=735
I highly recommend Devon Technologies WordService http://www.macupdate.com/info.php/id/10523/wordservice as it handles so many additional functions such as reformatting and line sorting as well as statistics within all Cocoa apps (plus it's free).