Can this AppleScript command receive its data from a KM variable?

I have the following line working in an AppleScript action:

key code kmLocalVar1 using { }

And I know how to add key modifiers to it, like this:

key code kmLocalVar1 using { shift down, command down }

But what I don't know how to do is how to pass the final parameters (e.g., "shift down, command down") as a variable obtained from KM. I don't want to have to write 16 different AppleScript actions to handle all 16 possible combinations of shift, command, control and option. As it is written, it looks like an AppleScript "list", but it's not a list, because lists contain quoted strings. These look more like AppleScript keywords. Am I really going to have to write 16 different AppleScript actions to handle all the cases?

This seems to do the trick:

AppleScript Hotkey (Example- New Folder in Finder).kmmacros (22 KB)

Macro screenshot

I already trust you that that will work. But I'll wait before clicking solution until I test it tomorrow.

I read about AppleScript lists and they always contained quoted strings, and numbers. But somehow you seem to have found a command to do what I need.

1 Like