iansinnott / alfred-maestro Goto Github PK
View Code? Open in Web Editor NEWAn Alfred workflow to execute Keyboard Maestro macros.
License: MIT License
An Alfred workflow to execute Keyboard Maestro macros.
License: MIT License
This is the only Alfred workflow I use daily that doesn't work on Big Sur on my M1 Mac mini.
When run and watching status in the Alfred Debugger, I get a segmentation fault in "Alfred-maestro":
[08:15:58.863] Alfred Maestro[Script Filter] Queuing argument ''
[08:15:58.953] Alfred Maestro[Script Filter] Script with argv '' finished
[08:15:58.957] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/88A3D907-9F16-491E-86A7-634FC4ACA163: line 1: 39585 Segmentation fault: 11 ./alfred-maestro "$1"
[08:16:10.713] Logging Stopped.
[08:24:56.025] Logging Started...
[08:25:06.217] Alfred Maestro[Script Filter] Queuing argument ''
[08:25:06.309] Alfred Maestro[Script Filter] Script with argv '' finished
[08:25:06.314] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/8B2B22BA-40FB-48C3-9048-C3A4CE2D8A37: line 1: 40663 Segmentation fault: 11 ./alfred-maestro "$1"
[08:25:07.546] Alfred Maestro[Script Filter] Queuing argument 'd'
[08:25:07.667] Alfred Maestro[Script Filter] Script with argv 'd' finished
[08:25:07.674] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/8B2B22BA-40FB-48C3-9048-C3A4CE2D8A37: line 1: 40665 Segmentation fault: 11 ./alfred-maestro "$1"
Since Alfred-maestro is an x86 executable, this is running under Rosetta. I have just upgraded to macOS 11.1, which purports to have some upgrades to Rosetta, but it still doesn't work. If I run Alfred-maestro from the command line using arch -x86_64 ./alfred_maestro in Terminal I also get a segmentation fault.
The scripts in the workflow directory work properly and find my Keyboard Maestro macros.
Any help or suggestions?
I use a lot of iOS shortcuts to trigger KM macros, via "open url" kmtrigger://macro=DHD773-99IU-6D44-893D-XXXXXXXX
Later when I want to modify one of those macros, I glance at shortcuts, see the UUID, and search KM by the last few digits. Any way to implement in this shortcut?
Requirements checked. Checked the workflow I wanted to execute was enabled.
Reinstalled the latest version of the workflow.
Tried the comment fix. http://www.alfredforum.com/topic/3447-alfred-maestro-keyboard-maestro-integration-for-alfred/?p=35176
Still no macros in the results. No error in Alfred's console.
The macro in KM usually doesn't change that often, I am wondering for the next update is it possible to add "cache result" to improve the speed. Sometimes when I type too fast, the tiny lag cause triggering the wrong macro. Thanks for the great work, this is my most used Alfred workflow. :)
Would it be possible to do?
For example, I am in Safari, I trigger a script filter and it will only show me macros that are scoped to this application as well as global macros I have made.
Here is what I mean :
I just want macros shown from this group and the global ones that I have.
This would be very useful for me. Thank you.
We should implement an auto-updater in the workflow, so users don't have to update it manually.
AwGo, the library used in this workflow, has an API for that.
I've seen users like @nikitavoloboev, who have the ability to directly search and call macros. How can I enable this? It would be nice to not have to type km everytime if possible.
source: https://forum.keyboardmaestro.com/t/why-do-you-love-km/5354
Thanks!
How do I get rid of this error?
I also posted this on the Alfred Forums. When I load Alfred and start typing "KM" I see the "do KM" command very briefly and then it disappears. Looking in the console I see this error from the moments I attempt to use the plugin:
12/4/13 5:55:17.479 PM Alfred 2[378]: [ERROR] Script XML Parse Error occured Error Domain=NSXMLParserErrorDomain Code=4 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)" UserInfo=0x60000027f500 {NSXMLParserErrorColumn=1, NSXMLParserErrorLineNumber=1, NSXMLParserErrorMessage=Document is empty
}
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.
It would be really useful I think.
Thank you.
Is there any plans to publish it on https://alfred.app/search/?q=maestro?
It would be really awesome if you could open the macro in the KM editor for editing instead of running the macro. Perhaps do it with a modifier key users can set.
I can help add this but I am not very familiar with PHP.
Hi, anyone got this working in Big Sur at all ?
Have it working in Catalina following the advice in #25 but no luck with Big Sur.
Is it broken or just more macOS permission issues ?
Thanks
Not sure if KM provides the list but I believe it should.
It would be great if we could search through a list of recently ran macros, sorted by the last time they were fired off (most recent top).
It seems that this workflow doesn't work in macOS Catalina anymore.
@iansinnott, @nikitavoloboev can you check that, please? I don't plan to upgrade my OS version yet since Catalina doesn't support 32-bit apps.
I just installed the workflow, everything seems to work just fine. But when adding a new macro it just will not show up in the results. Do I need to clear some sort of cache?
Let's figure out what new changes would be helpful in the next version! This lib has been exactly what I myself needed for a while now so I haven't given a whole lot of thought to possible improvements. But @nikitavoloboev has made some good suggestions in the past and I think aggregating all suggestions together here will help bring them to fruition.
IMPORTANT NOTE: The feasibility of any of these features depends entirely on the KM scripting API. So some features might actually be impossible to implement without changes to KM itself.
So, with that said, let's talk features. Here are some ideas that have been raised in the past:
Furthermore, I wrote this lib a long time ago when PHP was my primary language but that has since changed and probably hinders contributions to this library. So, I'm considering a full rewrite in either Python or JavaScript (Sidenote: this whole lib is less than 200 lines of code, so a full rewrite shouldn't be too onerous).
I'm interested in feedback on all of this and if anyone has ideas on other features that would make this lib more useful please add them!
I just discovered this is possible. Could be quite useful. I recently found myself needing this while running a roughly 2 minute macro accidentally a second time.
https://forum.keyboardmaestro.com/t/how-to-break-in-the-middle-of-a-macro/568
An ideal solution would support cancelling individual macros as well as listing running macros. Better yet, AM could warn you or display some information to let you know that a macro is running.
Currently during the development, I use a custom make command to copy the executable to the workflow directory to test it. This works well, but since the Alfred workflows directory might have a different path on other developer's machine my command won't be really useful for them.
We could use alfred CLI tool and its link command for that (thanks @nikitavoloboev for the suggestion!).
Another solution is to find a way to determine a path of the Alfred workflows directory. Then my script could be used by other developers. Though, by now I've found no easy way to determine the path.
Packal is a directory of Alfred workflows. It'd good to submit alfred-maestro to it, so more people find out about it and start using it.
@iansinnott would you prefer to submit it to your own account or let me do that?
I'm using your lovely Alfred Workflow for KM but it's only finding Global Macros. Am I doing it right?
OS X 10.9
Keyboard Maestro 6.3
PHP = ? (how do I find out?)
I'd like to conveniently call Keyboard Maestro macro by name as default fallback. My current implementation is adding a Fallback Search
trigger and connecting it to Script Filter like this:
However, I'd like to trigger the closest match when I hit the KM fallback option, if possible.
I have no experience in Go, with little experience with AppleScript. Open to discussion, and might help if I can.
Below script would jump to Global Macro Group
in KM:
try
set macroGroupName to "Global Macro Group"
tell application "Keyboard Maestro"
if macro group macroGroupName exists then
select macro group macroGroupName
else
error "Cannot select macro group " & macroGroupName & " — it is missing!"
end if
end tell
on error e number n
set e to e & return & return & "Num: " & n
if n ≠ -128 then
try
tell application (path to frontmost application as text) to set ddButton to button returned of ¬
(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
default button "OK" giving up after 30)
if ddButton = "Copy Error Message" then set the clipboard to e
end try
end if
end try
try
tell application "System Events"
tell application process "Keyboard Maestro"
tell window "Keyboard Maestro Editor"
tell scroll area 2 of splitter group 1 of group 1
set focused to true
end tell
end tell
end tell
end tell
on error e number n
set e to e & return & return & "Num: " & n
if n ≠ -128 then
try
tell application (path to frontmost application as text) to set ddButton to button returned of ¬
(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
default button "OK" giving up after 30)
if ddButton = "Copy Error Message" then set the clipboard to e
end try
end if
end try
------------------------------------------------------------------------------
We need to get a list of KM groups and then search through them like we do with macros. On activate, we should jump to the list.
Has anyone verified that this workflow is compatible with Keyboard Maestro 9?
I would like to see the macro groups that the macros I am searching are placed in. I know subtext is currently being used to show active hotkey triggers. Perhaps we could also add the macro group in there as prefix?
i.e. It would show: 2Do: ⌘↵
on a task that is placed in 2Do
group with ⌘↵
as hotkey trigger.
What do you think?
Hello,
When using your Alfred workflow, I am unable to pull up my custom macros. Only the default macros show up.
Possible issues:
Thanks for your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.