Keyboard Maestro 8.2.4 “Literary Toolbox” Palette


#1

palette

Name: Literary Toolbox
Author: Mike Pasini
Version: 1.0a
Last Update: 3 December 2018


UPDATED: 2019-03-17 13:29 GMT-5


This set of macros can be used to evaluate text in several different ways. They can be helpful to authors but also to readers evaluating or studying various texts.

They each work on a text selection rather than a discrete file, parsing the selection copied to the clipboard and stripping it of any style information before analysis.

That helps (if isn't quite a cure) for text selected in a word processor. But you should have no problem with text selections made in any editor or within a Web browser.

Some of the tools push the limits of what an algorithm can tell us about human communication but we still find them useful if not for raw data at least for comparisons or trends.

We've used some of these for years and some for a few months. And while they do tap into the power of some third-party code, only a couple rely on commercial software and even those have free equivalents.

Keyboard Maestro provides a simple interface to these tools. A palette (with an optional custom color scheme) organizes them for easy recall. And custom HTML forms that use the same color scheme as the palette provide easy-to-read reports.

Sample reports:

ss-769

ss-772

ss-778

ss-777

The .zip file contains the PDF documentation and the complete palette.

LiteraryToolbox.10a.zip (783.5 KB)


Best Macro List
#2

Attempted install cpanm got this error:

BernsHome$ curl -L http://cpanmin.us | perl - --sudo App::cpanminus
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 295k 100 295k 0 0 1134k 0 --:--:-- --:--:-- --:--:-- 1137k
--> Working on App::cpanminus
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ... OK
Configuring App-cpanminus-1.7044 ... OK
Building and testing App-cpanminus-1.7044 ... FAIL
! Installing App::cpanminus failed. See /Users/BernsHome/.cpanm/work/1544194574.41445/build.log for details. Retry with --force to force install it.

Here's the last line of the build.log with the failed step:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
-> FAIL Installing App::cpanminus failed. See /Users/BernsHome/.cpanm/work/1544194574.41445/build.log for details. Retry with --force to force install it.

Do you have any suggestions?

Thanks!


#3

I do have Xcode installed, which may have created that missing directory for me.

One simple thing to try at the commend line is this solution:

xcode-select --install

Hope that helps!


#4

Installing the command line developer tools handled the cpanminus install.

Now the last distribution from "cpan at https://metacpan.org/ pod/Lingua::EN::Grammarian" to retrieve the caution and error files returns a 404 page not found error.

Any other way to get the files?

Thanks!


#5

That URL looks suspicious (there's a space in it). But the original source does specify this command line:

cpanm Lingua::EN::Grammarian

(And you'll need that link to get the error and caution files, too.)

Addendum:

I found the cpan install for Grammarian from my Terminal session and it looks like this:

MikePasinisMBP:~ mrpasini$ cpanm Lingua::EN::Grammarian --sudo
--> Working on Lingua::EN::Grammarian
Fetching http://www.cpan.org/authors/id/D/DC/DCONWAY/Lingua-EN-Grammarian-0.000005.tar.gz ... OK
Configuring Lingua-EN-Grammarian-0.000005 ... OK
Building and testing Lingua-EN-Grammarian-0.000005 ... Password:
OK
Successfully installed Lingua-EN-Grammarian-0.000005
1 distribution installed

#6

You are correct. The Literary Toolbox pdf version has that URL with a line wrap. Copying and pasting from the pdf inserts a space where the line wraps to the next line. Removing the space got me to the correct page.

Onto installing the error and caution files...

Thanks!


#7

Thanks for your persistence. When you get through the installation, I'll update the PDF to cover these issues.

13 Dec. Update

I'll replaced the original distribution above with the same macro file but updated documentation to reflect the discussion above.


#8

Hi, I managed to install everything but some macros are not running. During the installation process these were the errors:

ERROR #1
==> Found dependencies: Package::Stash::XS
--> Working on Package::Stash::XS
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-XS-0.29.tar.gz ... OK
Configuring Package-Stash-XS-0.29 ... OK
Building and testing Package-Stash-XS-0.29 ... FAIL
! Installing Package::Stash::XS failed. See /Users/Alfredo/.cpanm/work/1547686509.2318/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Package::Stash::XS' is not installed
! Bailing out the installation for Package-Stash-0.38.
! Installing the dependencies failed: Module 'Package::Stash' is not installed
! Bailing out the installation for namespace-clean-0.27.
! Installing the dependencies failed: Module 'namespace::clean' is not installed, Module 'strictures' is not installed
! Bailing out the installation for Lingua-EN-Opinion-0.1300.

ERROR #2
Configuring Lingua-EN-Tagger-0.30 ... OK
==> Found dependencies: HTML::Parser
--> Working on HTML::Parser
Fetching http://www.cpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.72.tar.gz ... OK
Configuring HTML-Parser-3.72 ... OK
Building and testing HTML-Parser-3.72 ... FAIL
! Installing HTML::Parser failed. See /Users/Alfredo/.cpanm/work/1547686534.3287/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'HTML::Parser' is not installed
! Bailing out the installation for Lingua-EN-Tagger-0.30.

What do yo recommend me to do?
Thanks in advance!


#9

Take a look at the log files reported by the install process:

  • See /Users/Alfredo/.cpanm/work/1547686509.2318/build.log for details
  • See /Users/Alfredo/.cpanm/work/1547686534.3287/build.log for details

There may be something cpanm does not expect about your Perl installation.


#10

Hi MrPasini,
1-Tried to install Perl, but got an ERROR: "Please delete /Users/MyUser/.cpanm and then re-run this command.

2- Got rid of ".cpanm" using "sudo rm -rf /Users/MyUser/.cpanm"

3- Installed Perl again by means of "curl -L http://xrl.us/installperlosx | bash"

4- Got Perl 5, version 28, subversion 0 (v5.28.0)

5- It runs better

Nevertheless, for some functions I still receive this ERROR:
"Can't locate Lingua/EN/Fathom.pm in @INC (you may need to install the Lingua::EN::Fathom module)
(@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /var/folders/py/gvw054lj2j171rhjn6zd01kh0000gn/T/Keyboard-Maestro-Script-A353C5A9-22B9-453F-A67C-BF4821581A95 line 3. BEGIN failed--compilation aborted at /var/folders/py/gvw054lj2j171rhjn6zd01kh0000gn/T/Keyboard-Maestro-Script-A353C5A9-22B9-453F-A67C-BF4821581A95 line 3."


#11

Well, same answer as last time. Your Perl installation is not standard.

MacOS ships with Perl installed (and has for a long time). On Sierra, which is what I'm running, the installed version is v5.18.2 and can be found in /usr/bin/.

Assuming that installation, cpanm will install the required modules where Perl can find them.

The error message you are getting is telling you that your Perl installation can't find the required modules in any of the places it normally looks (that's what the @INC is all about). You'll notice most of those places are in "5.18" subdirectories, which would not be accessed by Perl v5.28.

You can add directories to that list, of course, but I suspect you don't know where the modules were installed.

If, that is, the modules have actually been installed, which isn't clear. That would have appeared between steps 4 and 5.

You might try reinstalling the modules so they're accessible to your new Perl installation. Or, failing that, fall back to Perl 5.18, which is what your @INC is expecting.

With a clean install of MacOS, you don't need to install Perl and the default Perl installation will find any modules installed by cpanm.

You have a custom install of Perl somewhere on your disk ("which Perl" in Terminal will tell you where) and that install can't find the required modules for this palette.


split this topic #12

3 posts were merged into an existing topic: Next version of KM in 2019?


#13

I discovered an issue with the regex in the Most Frequentlty Used option which did not isolate the strings as complete words, omitting longer words from the counts. Version 1.0b corrects that:

Literary Toolbox.10b.zip (783.8 KB)


#14

Thanks for the update.
To ensure that all new readers see your latest update, I added your update post to your OP. Please feel free to further edit if you so desire.