HashTag Macro KM 7.0

Nothing fugly that I can see : - )

FWIW, mileage may vary, but I personally find it quicker (in terms of scripter time) to use .map(), which skips past having to set up and keep an eye on various variables and iterators etc.

e.g., perhaps:

function run() {
    var kme = Application('Keyboard Maestro Engine');

    return kme.variables['hashtags'].value()
        .split(',')
        .map(function (x) {
            var cbVal = x.trim();

            return '<label><input type="checkbox" name="checkbox" value="' +
                cbVal + '" data-ignore></input>' + cbVal +
                '</label>\n<br />';
        })
        .join('\n');
}
1 Like