Page 1 of 1

Flesch–Kincaid

Posted: Wed Nov 29, 2017 7:37 pm
by ve7tcc
I just upgraded to v3, but I can't find the Flesch–Kincaid stats. I thought this was in the new version?

Re: Flesch–Kincaid

Posted: Wed Nov 29, 2017 7:42 pm
by AmberV
Not sure where you heard that; the only thing added within that rough domain is an estimated reading time counter. Click on the stats area in the text footer bar for extended statistics.

Re: Flesch–Kincaid

Posted: Wed Nov 29, 2017 9:33 pm
by ve7tcc
Ok, well I built my own add-on, using services.

Screen Shot 2017-11-29 at 1.31.05 PM.JPG
Screen Shot 2017-11-29 at 1.31.05 PM.JPG (67.3 KiB) Viewed 4171 times


Screen Shot 2017-11-29 at 1.31.18 PM.JPG
Screen Shot 2017-11-29 at 1.31.18 PM.JPG (89.9 KiB) Viewed 4171 times

Re: Flesch–Kincaid

Posted: Wed Nov 29, 2017 9:38 pm
by AmberV
Nice! I'd say that's an exemplary use of Services.

Re: Flesch–Kincaid

Posted: Fri Dec 01, 2017 1:35 pm
by NamoNakiMichi
HOW DID YOU DO THAT?! Please expound!!!

Re: Flesch–Kincaid

Posted: Sun Dec 03, 2017 3:21 am
by ve7tcc
Are you on a mac? Services are part of macos. You can create one in Automator.

Here is the workflow I created:

Screen Shot 2017-12-02 at 7.09.56 PM.JPG
Screen Shot 2017-12-02 at 7.09.56 PM.JPG (118.58 KiB) Viewed 4057 times


You need Flesh command line, from here: https://sourceforge.net/projects/flesh/files/flesh/Flesh/Flesh-Command--Line.zip/download

You also need to make a shell script to display the dialog with the results:

Screen Shot 2017-12-02 at 7.10.48 PM.JPG
Screen Shot 2017-12-02 at 7.10.48 PM.JPG (61.28 KiB) Viewed 4057 times


This calls applescript to show the results in the dialog. Now, any time I select some text, in any app, I can use the Flesch–Kincaid service to tell me what grade level I am writing at.

Re: Flesch–Kincaid

Posted: Sun Dec 03, 2017 10:15 pm
by NamoNakiMichi
ve7tcc wrote:Are you on a mac? Services are part of macos. You can create one in Automator.

Here is the workflow I created:

Screen Shot 2017-12-02 at 7.09.56 PM.JPG

You need Flesh command line, from here: https://sourceforge.net/projects/flesh/files/flesh/Flesh/Flesh-Command--Line.zip/download

You also need to make a shell script to display the dialog with the results:

Screen Shot 2017-12-02 at 7.10.48 PM.JPG

This calls applescript to show the results in the dialog. Now, any time I select some text, in any app, I can use the Flesch–Kincaid service to tell me what grade level I am writing at.


The dialog is blank. The Java part is working, but the applescript isn't picking up the output. What am I missing?

Re: Flesch–Kincaid

Posted: Mon Dec 04, 2017 5:18 am
by gr
You might want to fix all the occurrences of 'Flesh' in that utility. I gather the correct name is 'Flesch'.

gr

Re: Flesch–Kincaid

Posted: Mon Dec 04, 2017 7:47 am
by devinganger
NamoNakiMichi wrote:
ve7tcc wrote:Are you on a mac? Services are part of macos. You can create one in Automator.

Here is the workflow I created:

Screen Shot 2017-12-02 at 7.09.56 PM.JPG

You need Flesh command line, from here: https://sourceforge.net/projects/flesh/files/flesh/Flesh/Flesh-Command--Line.zip/download

You also need to make a shell script to display the dialog with the results:

Screen Shot 2017-12-02 at 7.10.48 PM.JPG

This calls applescript to show the results in the dialog. Now, any time I select some text, in any app, I can use the Flesch–Kincaid service to tell me what grade level I am writing at.


The dialog is blank. The Java part is working, but the applescript isn't picking up the output. What am I missing?


Pop open a Terminal window.

In the Automator workflow above, you see the reference to /Users/duncan/Scripts?

Change that "duncan" to your username (mine is devin) and make sure you create the Scripts folder underneath your home directory (mine was /Users/devin/Scripts) and change its mode to 700 (owner read/write/execute, everyone else none). In the Terminal window, I would run:

Code: Select all

mkdir Scripts
chmod 700 Scripts


Capitalization is important! If your folder name is scripts not Scripts, you have to change the command in the workflow to be the same case.

Now, take the shell script and save that as a text file named dialog inside your new Scripts folder. Change its mode to 500 (owner read/execute, everyone else none).

Code: Select all

chmod 500 dialog


You can then test and make sure everything is working right in Terminal:

Code: Select all

cat sometextfile | java -jar /Applications/Flesh-Command--Line/CmdFlesh.jar | /Users/devin/Scripts/dialog.


Be sure to modify the "devin" to be your username. If that doesn't work, then something about the folder or the dialog script file isn't correct. Try running the dialog script manually.

Re: Flesch–Kincaid

Posted: Mon Dec 11, 2017 6:08 am
by ve7tcc
gr: the product is called Flesh

devin: you got it right!
The paths to the script and java application could be changed to somewhere neutral. I just shared what I did.

Na: getting any closer?

Re: Flesch–Kincaid

Posted: Tue Dec 12, 2017 3:51 am
by gr
ve7tcc wrote:gr: the product is called Flesh


Well, curious if intended, but okay. Still, there are problems, to wit (your screenshot):

Screen%20Shot%202017-11-29%20at%201.31.18%20PM.JPG
Screen%20Shot%202017-11-29%20at%201.31.18%20PM.JPG (89.9 KiB) Viewed 3855 times

Re: Flesch–Kincaid

Posted: Tue Jul 23, 2019 2:10 am
by nbrgll
Hello

I've followed the directions on this page, but can only get the dialog box to display the variable "cat." What am I missing?

Thanks!

Re: Flesch–Kincaid

Posted: Wed Oct 07, 2020 11:03 pm
by anthonyz
nbrgll wrote:Hello

I've followed the directions on this page, but can only get the dialog box to display the variable "cat." What am I missing?

Thanks!


I ran into this problem too. It took nearly an hour grinding to figure it out. The trick here is that "cat" MUST be surrounded by back ticks (under the ~ on my keyboard) and not regular ticks (under the " on my keyboard).

Also for those of you on Mohave or later, the type of Automator you want to create is called a "Quick Action".

A final niggle that I was doing wrong: This only works on SELECTED text. If you do not have any text highlighted/selected and go to the services menu, the Flesch-Kincaid option will not be shown!