Is there a way I can use Applescript to pass a record or list of records or specific custom metadata fields to Keyboard Maestro?
I suppose saving to the system clipboard is one way but that probably works only for one particular item. If I want to pass several metadata items or several records how would I do that?
Basically, you’d use one
tell block for DT to build the record. Another
tell block would then have to pass it to KM.
Should be something like
tell application id "com.stairways.keyboardmaestro.engine"
setvariable "myVar" to myAppleScript_string
but not at home so better check How to pass variable from applescript to km.
Note that if you get this variable via AppleScript from Keyboard Maestro then it’s a string.
From the documentation
setvariable method : Set the value of a variable.
setvariable text : the variable
[instance: text] : the macro execution instance (from environment variable KMINSTANCE).
to: text : the variable value