How To Script Streamdeck with Autohotkey

Getting To Know The El Gato Stream Deck Part 2

January 3, 2018

The Elgato Stream Deck is a powerful control surface add-on for colorists, especially when paired with autohotkey. In this insight, learn to take that functionality to the next level with advanced scripts and workflow examples.


Series
Day 3: 24 Insights in 24 Days 2018 New Year Marathon

Taking the Stream Deck to the next level

I’ve made no secret of my love for the Elgato Stream Deck. When I first discovered the product, I immediately saw its potential to help colorists work faster and smarter. Since then, I’ve been using it myself and recommending it to other colorists.

After convincing Robbie to buy one for himself, he published a fantastic insight giving a broad overview of the Stream Deck. Unfortunately, there was one big disadvantage: The Stream Deck is designed for gamers, not colorists. A lot of its built-in functionality isn’t things colorists will use. Our main focus is on its ability to hit hotkeys, and to launch external programs – and it’s that ability to launch an external program that can really open up the Stream Deck’s potential..

Autohotkey and Stream Deck

In Part 1, we introduced autohotkey, an open source scripting language designed to build keyboard and mouse macros. In this Insight, I’m going to show you ways to use autohotkey to take that functionality to the next level. Each autohotkey script can be instantly launched from the Stream Deck, and can not only can you take control of your mouse and keyboard, but you can actually do logic and file I/O for saving settings or values.

Weather you use a Stream Deck, or any other macro controller capable of launching external programs – I’ll give you an overview on how to use autohotkey to unleash the full potential of advanced macros for color grading work.

About Stream Deck 2.0 Public Beta

While originally designed as a gaming peripheral – Elgato has recognized the potential of the Stream Deck for professional workflows, and has recently released a public beta of Stream Deck 2.0. This release includes new features squarely aimed at professionals like colorists. Specifically, they’ve added smart profiles to use the Stream Deck with multiple applications, and the ability to combine multiple Stream Decks to expand the number of buttons available.

The upcoming 2.0 release of the Stream Deck software has a number of improvements for professional users, including multiple device support and smart profiles.

Links & Bonuses

  • Download 3 Scripts – For Premium members, I’ve made the 3 scripts explained in this Insight available as examples for you to download. Just keep in mind – these scripts are tuned to my specific machine, and my specific display resolution (I’ve tested against 1920×1080 and 2560×1600); they may not work on all systems right out of the box but if you have Resolve set to fullscreen, in my testing the menus don’t change much from resolution to resolution. Still, you might need to adjust some mouse coordinates and delay times to optimize them for your system. Consider these as examples to help you get started more quickly.For Premium members, the download link for the scripts is below the video.
  • Stream Deck 2.0 Public Beta – As with all beta software, back up your profiles before upgrading, and upgrade at your own risk. If you are in the middle of crucial projects, I would hold off on upgrading until you have time to troubleshoot any issues that may come up.
  • Visual Studio Code – Microsoft Visual Studio code is my preferred editor for Autohotkey scripts.

Enjoy and leave comments or examples of your scripts in the comments below!

-joey

Member Content

Sorry... the rest of this content is for members only. You'll need to login or sign up to continue (we hope you do!).

Membership options
Member Login

Additional Downloads

Sorry... downloads are available for Premium Members only.

Become a Premium Member

Comments

Homepage Forums Getting To Know The El Gato Stream Deck Part 2

Viewing 29 reply threads

    • Scott Stacy
      Participant

      Thanks for a great Insight, Joey. I can’t wait to expand into more complex scripts based on your hard work! And, pick up another deck.


    • Joey D’Anna
      Participant

      Thanks! Yea I already have 2, but I’m going to get a 3rd soon – I have this crazy idea of remoting it out and hard wiring/permanently mounting it into the armrest of the couch in my suite – so I can setup a set of transport/marker/etc controls for reviewing grades on my big LG OLED.


    • andi winter
      Participant

      i switched to linux a year ago… but i would really love this for CENT OS! unfortunately osx and win only 🙁


    • Joey D’Anna
      Participant

      The good news is theres a decent amount of excitement about the stream deck in the open source community – so even if official Linux support doesn’t exist, I think we’ll see some open source Linux support eventually.

      Theres 2 very basic open source projects out there already:
      https://github.com/Lange/node-elgato-stream-deck
      https://github.com/WElRD/StreamDeckCore

      Currently these are just APIs, so any user facing functionality would have to be hand-coded. I’ve tested the node.js one, and it does work. Hopefully someone in the open source world will come with a user-facing application similar to the native windows one that works in Linux, that could be really cool.


    • Jason Bowdach
      Participant

      Thats a very sweet idea. Still working on getting my single unit working as smoothly as you have it. Thanks for sharing!


    • Christophe Delaunay
      Participant

      Fantastic device, and Insight ! Problem is AutoHotKey is PC only. As suggested by Robbie in part 1, I have downloaded Keyboard Maestro for Mac and give it a try. It goes less deep than the programming level you’re showing here (no I/O on disk for example), but if I manage to get something useful, I’ll let members know. Good work Joey.


    • Joey D’Anna
      Participant

      Thanks! Yes, unfortunately the mac options aren’t as good (which seems to be an industry trend these days). But I’ve been told that Elgato is going to be implementing their own native macro support eventually – if that happens (like keyboard maestro, it’s unlikely to be as advanced as AHK, but still way more useful then simple hotkeys) – The potential for mac users will be much better.

      I’ll say this – I’ve been running the stream deck for about 6 months now, and in that short time they have pushed out multiple big feature updates at a fast pace. They seem to be pretty committed to maximizing the device through software improvements, which is a great thing.


    • Ben Howard
      Member

      If you want the same level of capability, on a Mac, as Autohotkey, then you should check out HammerSpoon. It’s a LUA based automation framework that can do nearly everything AHK can do.


    • Ben Howard
      Member

      Keyboard Maestro has, probably, 98% of what most users need though. And HammerSpoon is super duper powerful but requires in-depth understanding of lua and programming.

      If you want to see what you can do with it, check out the FCPX helper app, CommandPost (they even have a streamdeck module built in). CommandPost is developed in and runs on HammerSpoon, so you can get very very sophisticated with it.


    • Robert A
      Guest

      Can someone give an example of how they launch a Keyboard Maestro macro from StreamDeck? Do you have to also write an applescript to call the macro? I’m having trouble getting it to work…


    • andi winter
      Participant

      that would be awesome! please keep us posted! i wrote an email to the official developers as well, and they replied: “Thank you for your suggestion, I will forward this through the appropriate channels, so it could possibly implemented in future releases! ” well, lets “hope for deliverance” with paul mccartney 🙂


    • Joey D’Anna
      Participant

      I’m just starting to play with keyboard maestro – so i’m not 100% sure on this, but in the macro editor, under the “trigger” menu – there is a dropdown menu to trigger the macro via a script. If you drop that down and select “by shell script” – it gives you a command you can copy and paste into a shell to trigger the macro.

      i’m thinking that may work if you paste it into the streamdeck application (thought I haven’t tested this yet – my only mac is running an older version of mac os that the streamdeck software doesn’t support – once I get it updated, I’ll be able to come back with more real-world info)


    • Simon Rabeder
      Participant

      Could you please do a video for mac users as well? Have you looked into MIDIgrade as well?


    • Simon Rabeder
      Participant

      How about using controllermate?


    • Robert A
      Guest

      I have it working now, with two Stream Decks. I use the Open action to open Applescripts which either call a Keyboard Maestro macro or just manipulate the menu items of Resolve directly. It’s a lot of work (making nice icons takes some time too), but I am very happy with the results. I may get a third!

      BTW, one current frustration, which they might fix in a future rev of the software, is that you can’t have one Streamdeck change the profile on the other. I found a workaround by scripting mouse clicks, but it’s a little janky…


    • Michael H
      Member

      In Keyboard Maestro, set your trigger (Triggered by any of the following:) to “Or by Apple Script”.

      Keyboard Maestro will autogenerate an AppleScript for you. Copy it and paste it into AppleScript and save it.

      Then set your Stream Deck to open that AppleScript and it will trigger Keyboard Maestro.


    • Benjamin C
      Participant

      Thanks a lot for this explanation


    • Matt Williams
      Guest

      Hi, this looks great. Is there anyway to use the scripting with OpenFX effects? I guess it would need a script to scroll through the effects, unless I guess you could program it to move the mouse to the search box and enter the name of the effect, which would then bring to the top, and then program a mouse click on it? But then how would you be able to program it to move the effect onto the node, since the node position will change with every node tree you create? It would be amazing to be able to shortcut OpenFX since these can be quite time consuming to apply and require mouse moves, and often I use the same settings everytime I apply an effect.


    • Joey D’Anna
      Participant

      Yea I think as it stands right now, trying to do an AHK script to navigate the OFX menu would be very difficult.
      BUT – resolve 15’s new integration of python and lua holds some powerful possibilities. I’m starting to explore the idea of using the streamdeck to call python scripts to control resolve.

      lots of possibility there, but the API is still very much in development and changing and not fully documented yet. Stay tuned – there could be some really cool stuff coming.


    • Sam Campos
      Member

      does anyone have problem with their stream deck working? mine works perfectly on one of my pc but on my main workstation resolve does not recognize any key. any help?


    • Patrick T
      Guest

      Great Insight.
      Curious, why are you writing out a file instead of just storing the incremental value in a variable? Is it because AutoHotKey does not recognize the Stream Deck’s keys?


    • eric b
      Guest

      so I’m pretty late to this party — I can’t seem to figure out where the Active Window Info tool is? or if it even exists now?

      its kind of nuts….there is pretty much zero mention of it on google….
      really struggling trying to find some alternative way to figure out my mouse coordinates. Any ideas?

      also, it seems when opening an .AHK file with the streamdeck, it simply opens the file in notepad rather than executing a script. this install of autohotkey apparently includes a ‘convert AHK to executable tool’, and when I convert the AHK to exe then the script runs as expected.

      still can’t figure out how to know my mouse position though….


    • Joey D’Anna
      Guest

      Hey Eric – the active window info should be in your start menu, under the auto hotkey submenu. Try searching for “window spy”.

      As for the .ahk files loading directly – all you need to do is make autohotkey the default application for .ahk files. Rightclick on a .ahk, choose open with -> other, and navigate to the autohotkey .exe, and make sure to select always use.

      But you have stumbled upon a great AHK feature – if you were going to some facility or system that you cant install the software on – you can actually compile your AHK scripts into simple executables that will run on any windows machine without AHK installed!


    • eric b
      Guest

      I figured it out, thanks. figured out the default application issue also.

      the other thing that was really throwing me was the concept of an application that runs headless. I now understand the concept.

      couple years ago when I started building out my Xkeys stuff (RIP Xkeys) I found MacroWorks (xkeys software) to be pretty deep, but generally moderately easy to use and logical…

      but autohotkey, man. This is really advanced stuff. A steeper learning curve for sure, but even more power potentially than macroworks.

      I’ve made significant progress. I have buttons in my sharpening folder to append a node, click sharpening, click the amount, and send 46, 47, 48, and 49, depending on the button and how much I want. From one button. amazing.

      I can’t believe it took me this long for me to jump on the stream deck train. thanks so much for this!


    • Steven Dakota Sheaves
      Guest

      just a thought, you probably have to have the software installed on both pc’s


    • Ernest S
      Guest

      Hi Joey,

      Great tut as always. I’m going in the opposite direction from KM to autohotkey.

      KM has this awesome feature that lets you select menu items by using the accessibility framework, instead of mouse position and mouse click.

      You add the menu selection “action” and it let’s you select the menu item.

      Autohotkey seems to have the same function, but in Windows 10, it’s seems like you can’t use accessibility framework to specifically select menu items. You can’t seem to use comm either. Seems like menu items are more locked down on PC then Mac. But this doesn’t make sense as Resolve is written in cross platform qt.io

      I posted my attempts to the autohotkey forum.

      Can you select menu items another way besides position and mouse click?

      https://www.autohotkey.com/boards/viewtopic.php?t=85561

      Thanks!


    • Joey D’Anna
      Guest

      Hey! I haven’t found a way unfortunately. AHK can do it, but windows resolve doesn’t seem to use the standard windows menu API, while on the Mac it does.


    • Lannie L
      Guest

      Does anyone use a Stream Deck XL on a Superrmicro 7048gr-tr? I just got one, and it causes my system to refuse to boot. My normal 15 key stream deck works fine. And I can plug the XL in after boot and it’ll work.


    • Mickey M
      Guest

      has anyone created scripts for a mac? needing to create one for inverting my qualifier lol


    • Pat Inhofer
      Guest
Viewing 29 reply threads
  • You must be logged in to reply to this topic.

Hundreds of Free Tutorials

Get full access to our entire library of 900+ color tutorials for an entire week!


Start Your Free Trial
Loading...