Pass KM Variable to Javascript Shell Script?


I'm really enjoying delving into more advanced scripting using Keyboard Maestro, Text Soap, and more, but I've run into a snag with one part of a macro.

I have a KM variable called "ugroup" that I would like to pass into this Javascript so that it could be part of the URL. I've tried to make sense of the Wiki page, but still can't figure out what I need to do for the variable to go here:

  return JSON.parse(
        '	/Applications/ -url "ulysses://x-callback-url/new-sheet?group={{{KM VARIABLE TO GO HERE}}}&silent-mode=YES"'

Any help in the right direction would be appreciated!

Thank you

That looks like a JXA script for a Execute a JavaScript For Automation action.
If so, then you need to do two things in your JXA script:

  1. Set a JXA Variable to the Get the Keyboard Maestro Variable
  2. Use the JXA variable to set a string for use with the .doShellScriopt