-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass arguments to a keyboard maestro macro? #29
Comments
Hey @davidawad, interesting use case. Unfortunately, it's not currently possible. The macros will be executed by AppleScript using the UID of the macro in question. In other words, no additional arguments are passed: -- The passed query is the UID of the macro
tell application "Keyboard Maestro Engine"
do script "{query}"
end tell |
hey @iansinnott sorry for the late reply. Then all you need to do is save the argument from alfred to clipboard, and KM just reads it from there. |
Ok I've done some digging into this, I'm not a go programmer but I'm pretty sure you can add an if statement around here: you can take the second argument, meaning
and just add an if statement on the filter, if it sees a For now, my workaround was to type the second arg and copy with |
what do you think @iansinnott ? |
This is a significant tradeoff and would break workflows for existing users, so I'm loth to introduce such a breaking change. One of the unstated goals when creating alfred maestro was to be able to call macros by name, allowing potentially long but semantically meaningful macro names. |
hrmm, maybe there's an option or flag we can set in the alfred script if users want to use the clipboard for arg passing? I wouldn't want to fork the plugin for this as you've done great work already. |
Hey Ian,
I don't know if this is documented somewhere, but is it possible to use alfred maestro to pass arguments into a keyboard maestro macro.
Meaning I could type 'km drive taxes' and then run a keyboard maestro macro that supplies 'taxes' or '$@' into my macro as a query param to google.com or use those variables however I want.
I would love to see an example of that if that’s possible.
Thanks so much.
The text was updated successfully, but these errors were encountered: