ian_989 Posted November 14, 2013 Posted November 14, 2013 (edited) Alfred Maestro Possibly the last workflow you will ever need for system tasks I recently started using Keyboard Maestro (KM), and so far I love it. So I made this workflow to allow you to execute any KM macro straight from Alfred. Downloads - My Site: http://iansinnott.com/blog/integrating-alfred-and-keyboard-maestro/ - GitHub: https://github.com/iansinnott/keyboard-maestro-alfred Basic Usage Type 'km' followed by the name of the macro you want to trigger. Dependencies Keyboard Maestro More Info Check out the readme in my Github repo linked above. Also, check out my blog post about these two apps if your interested in how I actually use it. That's also linked above as the first download link. Quick Note: I only tested this on the latest version of php (5.5.5 as of this writing). This is not the standard installed version that comes with new Macs, so if you have any trouble with the workflow let me know. Cheers, Ian Edited November 14, 2013 by ian_989 Larry R, thec13, alc and 4 others 7
raguay.customct Posted November 14, 2013 Posted November 14, 2013 it's dead for me on Maverick. I have not had time to figure out why.
rice.shawn Posted November 14, 2013 Posted November 14, 2013 What parts of php are you using? I can't remember everything that comes compiled into the native php5-cli binary (5.3 pre-Mavericks and 5.4 Mavericks). It looks like the 5.4 on Mavericks has curl, openssl, bzip, zip, gzip, mysql, mysqlnd, mysqli, sasl, soap, pcre-regex, and libxml among other things, and I think that the old 5.3 had a similar recipe (although I'd have to find a machine running that in order to check), so it probably doesn't have to do anything with that. Other possibilities: need to turn on accessibility for KM (I really hate how Apple re-did this for Mavericks). Deprecated php functions that are throwing errors rather than just warnings. Just some thoughts...
ian_989 Posted November 18, 2013 Author Posted November 18, 2013 Yeah I heard from someone else that they were having an issue, so I'm going to check it out. I'll post an update here if I find anything and update the workflow.
rspike12 Posted November 18, 2013 Posted November 18, 2013 Is it possible to see a list of the triggers that I have in KeyboardMaestro after typing "km"? I am using the workflow under Mavericks. It works but I have to write: km + "the exact name of the trigger" ...and I never remember the exact name of the trigger
ian_989 Posted November 18, 2013 Author Posted November 18, 2013 I just updated the workflow. I updated it at both of the links in my original post, so just re-download it from wherever you did the first time if you were having trouble. @raguay.customct, I think the update may solve your problem. Hey @rspike12, that's strange as it is indeed supposed to show all macros by simply typing in 'km'. It does on my system, and now that I just fixed a compatibility issue I don't think it's that either. Maybe an alfred specific setting? If you open up the script filter window make sure that 'with space' is checked after the keyword box and then the dropdown is set to 'argument optional'. crisssy101 1
crisssy101 Posted November 19, 2013 Posted November 19, 2013 I love that you are getting creative with Keyboard Maestro. Thank you!
politicus Posted November 22, 2013 Posted November 22, 2013 Working for me too (OS X Mountain Lion). Great workflow.
neverminding Posted December 4, 2013 Posted December 4, 2013 I'm on Mavericks with php 5.4.17. Getting the dreaded XML Parse Error: Alfred 2[8622]: [ERROR] Script XML Parse Error occured Error Domain=NSXMLParserErrorDomain Code=4 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)" UserInfo=0x618000266740 {NSXMLParserErrorColumn=1, NSXMLParserErrorLineNumber=1, NSXMLParserErrorMessage=Document is empty }
macdrifter Posted December 4, 2013 Posted December 4, 2013 Bummer. Seeing the same error on Mavericks when triggering the macro. PHP 5.4.17, Alfred 2.1.1: 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 }
macdrifter Posted December 6, 2013 Posted December 6, 2013 More info. I updated PHP to latest 5.5 and reinstalled Keyboard Maestro. I still receive the same error in the console when I attempt to run the workflow.
ian_989 Posted December 10, 2013 Author Posted December 10, 2013 Hey, thanks for the feedback. Glad to hear it's working for many of you. @macdrifter Thanks for opening an issue on GitHub, that brought this to my attention. For anyone with this 'XML parse error' issue try reinstalling and giving it another go. I wasn't able to find anything too specific about this issue, other than the fact that it manifests in other workflows as well. I'm hoping the update I just pushed will solve the issue for this particular workflow. Make sure to download it from GitHub, as I haven't updated the link on my own site yet: Updated Workflow: https://github.com/iansinnott/alfred-maestro
uscmeche Posted March 22, 2014 Posted March 22, 2014 Amazing script! Thank you. I was just about to code this myself, but thought I would search first.
politicus Posted February 25, 2015 Posted February 25, 2015 It would be very cool to be able to enable/disable a macro from Alfred. Are you planning on adding such a feature?
deanishe Posted February 27, 2015 Posted February 27, 2015 (edited) Hey, thanks for the feedback. Glad to hear it's working for many of you. @macdrifter Thanks for opening an issue on GitHub, that brought this to my attention. For anyone with this 'XML parse error' issue try reinstalling and giving it another go. I wasn't able to find anything too specific about this issue, other than the fact that it manifests in other workflows as well. I'm hoping the update I just pushed will solve the issue for this particular workflow. Make sure to download it from GitHub, as I haven't updated the link on my own site yet: Updated Workflow: https://github.com/iansinnott/alfred-maestro The usual cause of such an error message is some part of your code sending output to STDOUT (usually an errant echo/print statement). That output gets mixed in with the XML, making it invalid. (That's assuming your using a proper XML library to generate the output, not generating it in your own code.) Edited February 27, 2015 by deanishe
effe Posted March 21, 2015 Posted March 21, 2015 Hi, Thank you for this workflow. I'm just starting out with both Alfred and Keyboard Maestro. The workflow was not showing any KM macros when typing 'km'.. I ended up having to comment out your argv check, and it is working how I think it should, showing all KM Macros when typing 'km' in Alfred. Just commented out the two lines here: https://github.com/iansinnott/alfred-maestro/blob/master/main.php#L34-L35 With the control flow as it was, it was exiting there.. so there was no chance for the list to populate by reaching the 'else' case at the end of the script. -
Smith007 Posted August 29, 2015 Posted August 29, 2015 If you replace code: $macros[] = $macro; with if (strpos($macro['name'], 'alfredhide') === false) { $macros[] = $macro; } Then you can hide macros from being displayed on alfred if you add "alfredhide" to their names. Useful if you have macros that are executed only from within other macros. Cheers
rspike12 Posted May 24, 2016 Posted May 24, 2016 it doesn't work anymore on Alfred 3 Any help will be appreciated Yuri 1
dionmunk Posted September 19, 2016 Posted September 19, 2016 I just found your workflow and it is awesome! Thank you for the work you put into this. I love it.
bivalvegruff Posted October 8, 2019 Posted October 8, 2019 This broke with Catalina. Something about security and the developer having to update its "app" (workflow). The error message won't present itself again, it just doesn't work now.
tbrown Posted October 9, 2019 Posted October 9, 2019 This one was really important to me. When I upgraded to Catalina, it broke for me with a warning about malicious code or something. I figured it was a Catalina permissions problem of some kind. Here's what I did to fix it: 1. Cloned the git repository at https://github.com/iansinnott/alfred-maestro 2. I had to install go, which I did based on these instructions: https://golang.org/doc/install?download=go1.13.1.darwin-amd64.pkg 3. Following the instructions to build Alfred-maestro, I ran "make pack" in the Alfred-maestro directory. 4. Didn't work. Futzing around, I found that, in the Makefile, Alfred-maestro was to be copied into the workflow directory, but the build created alfred-maestro-master. So I changed line 8 of the Makefile to read: @mv alfred-maestro-master workflow/alfred-maestro 5. Ran "make pack" again and it completed successfully. 6. Installed my new Alfred-Maestro.alfredworkflow. 7. It worked! I did all this in terminal. Took me just a few minutes and now I am a happy user of Alfred-Maestro again. I have not seen this issue with other Alfred workflows I use regularly.
bivalvegruff Posted October 10, 2019 Posted October 10, 2019 14 hours ago, tbrown said: This one was really important to me. When I upgraded to Catalina, it broke for me with a warning about malicious code or something. I figured it was a Catalina permissions problem of some kind. Here's what I did to fix it: 1. Cloned the git repository at https://github.com/iansinnott/alfred-maestro 2. I had to install go, which I did based on these instructions: https://golang.org/doc/install?download=go1.13.1.darwin-amd64.pkg 3. Following the instructions to build Alfred-maestro, I ran "make pack" in the Alfred-maestro directory. 4. Didn't work. Futzing around, I found that, in the Makefile, Alfred-maestro was to be copied into the workflow directory, but the build created alfred-maestro-master. So I changed line 8 of the Makefile to read: @mv alfred-maestro-master workflow/alfred-maestro 5. Ran "make pack" again and it completed successfully. 6. Installed my new Alfred-Maestro.alfredworkflow. 7. It worked! I did all this in terminal. Took me just a few minutes and now I am a happy user of Alfred-Maestro again. I have not seen this issue with other Alfred workflows I use regularly. Thanks. Would you mind sharing the finished workflow? 🙂
tbrown Posted October 11, 2019 Posted October 11, 2019 My suspicion is that the workflow I created and use will still fail on your machine, since it is still not signed by an Apple developer. I think it only works for me because I created it locally and I can write and manage and execute scripts on my own machine without Apple caring--hence the instructions for building on your local machine. I also am uncertain as to whether it is proper for me to share the modified workflow here.
deanishe Posted October 11, 2019 Posted October 11, 2019 8 minutes ago, tbrown said: I think it only works for me because I created it locally Pretty sure this is correct. Catalina won't complain about binaries you compiled yourself.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now