Skip navigation

word count not recognized as integer variable

568 Views 4 Replies Latest reply: May 12, 2012 4:10 PM by BobHarris RSS
personal_username Calculating status...
Currently Being Moderated
May 12, 2012 10:49 AM

ok, i have this command:


set mywordcount to do shell script "wc -l < MyFile.txt"


which gives me the number of words of a given txt

with display alert it reports me number 1 when there is one word, number 4 if there are 4 words, etc...


the problem comes when i want to do one action if the file has 1 word, another if it has more than 1...

when i write:


if mywordcount = 1 then

myactions here


otheractions here

end if

it doesn't do anything at all...

any ideas?



More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.