I hope that the other replies give cause for hope. Since the solution by @nutilius works for him, hopefully it will work for you, but if for any reason using execute shell script proves too frustrating, try other options, e.g.
- Have the code output to a file.
- Set up KM actions to:
- activate the terminal;
- paste in that code;
- “press” Return.
- Then use the KM action
Read a fileand proceed from there.
That is far from elegant but… should all else fail, that might perhaps be an acceptable way to get the job done for the time being..!