Results 1 to 4 of 4

Thread: Word count for text files

  1. #1

    Default Word count for text files

    This may be an ignorant question but I wonder whether there is a way to word count a text file in EagleFiler without using an external app. An AppleScript may work but I am not much familiar with that. Any suggestion?

    Thank you,
    SL

  2. #2

    Default

    This script will show the word count for the selected files...

    Code:
    tell application "EagleFiler"
    	set _msg to ""
    	set theRecords to selected records of browser window 1
    	repeat with theRecord in theRecords
    		set _text to text content of theRecord
    		set _msg to _msg & ((count of words of _text) as text) & tab ¬
    			& " words in " & quote & filename of theRecord & quote ¬
    			& return & return
    	end repeat
    	display dialog _msg buttons "OK" default button "OK"
    end tell

  3. #3

    Default

    Wow, it works great!

    Much thanks,
    SL

  4. #4
    New Member
    Join Date
    Feb 2011
    Posts
    1

    Default

    Quote Originally Posted by GrumpyDave View Post
    This script will show the word count for the selected files...

    Code:
    tell application "EagleFiler"
    	set _msg to ""
    	set theRecords to selected records of browser window 1
    	repeat with theRecord in theRecords
    		set _text to text content of theRecord
    		set _msg to _msg & ((count of words of _text) as text) & tab ¬
    			& " words in " & quote & filename of theRecord & quote ¬
    			& return & return
    	end repeat
    	display dialog _msg buttons "OK" default button "OK"
    end tell
    Thanks Dave !

Similar Threads

  1. Searching contents of text files
    By brab in forum EagleFiler
    Replies: 9
    Last Post: 08-02-2013, 05:35 PM
  2. Find in non-text files
    By crux in forum EagleFiler
    Replies: 2
    Last Post: 10-16-2008, 05:29 PM
  3. Title field and Microsoft Word files
    By whardy7 in forum EagleFiler
    Replies: 8
    Last Post: 05-24-2008, 09:34 PM
  4. Check against Modifying text type files
    By jakejohn in forum EagleFiler
    Replies: 4
    Last Post: 10-24-2007, 02:59 PM
  5. Problem with importing text files via applescript
    By souheil in forum EagleFiler
    Replies: 4
    Last Post: 12-06-2006, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •