I'm in a midst of making a macro, which makes a instant template for my jobs. Currently, I'm stuck on making the "Prompt for User Input", to identified a entered value, for example, "21881_BigSalesFlyers" into two different variables. The job number (21881) & name (BigSalesFlyers). Is it's possible?
There are various routes – one approach is to use JSON tokens with [1]
, [2]
subscripts:
Split phrase.kmmacros (20.0 KB)
Code snippet creating JSON from JS action:
(() => {
'use strict';
const
kme = Application('Keyboard Maestro Engine'),
kmVar = k => kme.getvariable(k);
return JSON.stringify(
kmVar('somePhrase')
.split(kmVar('someDelimiter'))
);
})();