Flesch–Kincaid

User avatar
ve7tcc
Posts: 11
Joined: Thu Jan 10, 2013 10:53 pm
Platform: Mac

Wed Nov 29, 2017 7:37 pm Post

I just upgraded to v3, but I can't find the Flesch–Kincaid stats. I thought this was in the new version?
Duncan

User avatar
AmberV
Posts: 20613
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Wed Nov 29, 2017 7:42 pm Post

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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
ve7tcc
Posts: 11
Joined: Thu Jan 10, 2013 10:53 pm
Platform: Mac

Wed Nov 29, 2017 9:33 pm Post

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 385 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 385 times
Duncan

User avatar
AmberV
Posts: 20613
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Wed Nov 29, 2017 9:38 pm Post

Nice! I'd say that's an exemplary use of Services.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Na
NamoNakiMichi
Posts: 32
Joined: Sat Aug 06, 2016 7:13 pm
Platform: Mac + iOS

Fri Dec 01, 2017 1:35 pm Post

HOW DID YOU DO THAT?! Please expound!!!

User avatar
ve7tcc
Posts: 11
Joined: Thu Jan 10, 2013 10:53 pm
Platform: Mac

Sun Dec 03, 2017 3:21 am Post

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 271 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 271 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.
Duncan

Na
NamoNakiMichi
Posts: 32
Joined: Sat Aug 06, 2016 7:13 pm
Platform: Mac + iOS

Sun Dec 03, 2017 10:15 pm Post

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?

User avatar
gr
Posts: 1595
Joined: Wed Feb 14, 2007 3:57 am
Platform: Mac + iOS
Location: Florida

Mon Dec 04, 2017 5:18 am Post

You might want to fix all the occurrences of 'Flesh' in that utility. I gather the correct name is 'Flesch'.

gr
gr : Scrivener user : not affiliated with Lit^Lat

"Perhaps the true book is the one on the far side of the prism."

User avatar
devinganger
Posts: 912
Joined: Sat Nov 06, 2010 1:55 pm
Platform: Mac + Windows
Location: Monroe, WA USA
Contact:

Mon Dec 04, 2017 7:47 am Post

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.
--
Devin L. Ganger
Devin on Earth: http://www.devinonearth.com/
Plotter on the streets, pantser in the sheets

User avatar
ve7tcc
Posts: 11
Joined: Thu Jan 10, 2013 10:53 pm
Platform: Mac

Mon Dec 11, 2017 6:08 am Post

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?
Duncan

User avatar
gr
Posts: 1595
Joined: Wed Feb 14, 2007 3:57 am
Platform: Mac + iOS
Location: Florida

Tue Dec 12, 2017 3:51 am Post

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 69 times
gr : Scrivener user : not affiliated with Lit^Lat

"Perhaps the true book is the one on the far side of the prism."