But for many words that have multiple meanings, the first result of the shell script is verification of which meaning you would like to use to look for synonyms. For instance, the word "well" can be an adjetive meaning "good", or a noun meaning "a source of water"... and you have to select the appropriate word to lookup. Running this in Terminal therefore produces this result:
Screenshot: list of words (click to expand/collapse)
Obviously, the shell script needs further user input before it can supply a list of synonyms, but I'm not sure how to accomplish that via a KM run shell script. So is there anyway to have the shell script output the list of words (screenshot 1) to a variable or clipboard so I can populate a prompt user from list, and then use the selection to finish executing the shell script?
The macro I am working on is below if anybody needs/wants to take a look at it.
Since I'm just waking up now, my response will be short. The first thing I would do is run the program once, sending it a value of 1 as its input, and fetch all the results. Then I would display those results using KM. Then I would get the user's choice via a KM response. Then I would rerun the shell command a second time to give it the correct choice response, and process the output (last line?) to get the real value.
I bet I can use that to filter the lines between "Definitions" and "Select" to produce a list that I can then select from using the prompt with list action... thank you Sleepy! I'm gonna tinker with this later today!
Hey Sleepy, your idea worked out for me and I was able to make it happen. This is a VERY rough draft (that just uses the word "well" since it's still in development) and no doubt it can be greatly improved on, but at least I have it up and running. Thanks again for your help!