1 2 Previous Next 18 Replies Latest reply on Jul 7, 2017 12:13 PM by Tyler Garrett

    Anybody want more keyboard shortcuts? Here is an AHK script

    Corey Turner

      **UPDATE FOR WINDOWS**

       

       

      Mark Fraser pointed this out on another idea...

       

      Alt + A + C    (Opens Create Calculated Field Window)

      Alt + F4         (Closes Calculated Field Window)

       

       

      **************************************************

       

      I finally got fed up with Tableau not having enough shortcuts... Here is an AutoHotKey script that adds some shortcuts. Hopefully someone finds it useful

       

      ctrl-shift C = Create Calc Field

      ctrl-shift D = View Data

      ctrl-shift P = Publish Workbook

      ctrl-shift HOME = Click and drag-move pill to dimensions list

      ctrl-shift R (while over a pill in dimensions / measures) = Rename a field

       

      Tableau Desktop Keyboard Shortcuts - AHKScript (an AutoHotkey Forum)

       

       

       

      ***EDIT***

       

      In case anybody is using this script... I've noticed a couple of scenarios when shortcuts may break down and not work correctly...

       

      The "Create Calculated Field" shortcut will not work properly when there are no parameters in the workbook. This is because Tableau will show a new "Parameters" button in the Analysis menu and I've hard-coded the position of the "create calc field" button when the parameters button exists. I don't think there is a way to tell how tall the analysis menu is in autohotkey and figure out where it should click.

       

      The "Rename a field" breaks down when you are able to paste something in the dimensions / measures / parameters list. The functionality will actually just duplicate your field.

       

      Message was edited by: Corey Turner

        • 1. Re: Anybody want more keyboard shortcuts? Here is an AHK script
          Corey Turner

          Feel free to modify this. If you have a specific request for more shortcuts I'll see what I can do to accommodate it.

          2 of 2 people found this helpful
          • 2. Re: Anybody want more keyboard shortcuts? Here is an AHK script
            Toby Erkson

            Pretty cool, thanks for sharing

            1 of 1 people found this helpful
            • 3. Re: Anybody want more keyboard shortcuts? Here is an AHK script
              Daniel Vincent

              Find equivalent for the Mac

              1 of 1 people found this helpful
              • 4. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                Shawn Wallwork

                I want to encourage this conversation, in the sense of: What shortcut keys do you want? Or feel are missing?

                 

                --Shawn

                 

                PS: I suspect T will consider your suggestions.

                1 of 1 people found this helpful
                • 5. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                  Corey Turner

                  Sounds like a challenge! Might be possible with keyboard maestro...

                  1 of 1 people found this helpful
                  • 6. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                    Corey Turner

                    I think it would be sweet to click a pill (that is a calculated field) and do a shortcut to edit it in the calculation editor - NOT the shelf. Even if they just added this to the context menu for right click that would be a good start. I don't like having to find my field in question in the list of dimensions or measures and right click -> Edit.

                     

                    And yes, I realize this should be part of the ideas.... I just think it is too insignificant compared to some of the other ideas out there.

                    1 of 1 people found this helpful
                    • 7. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                      Shawn Wallwork

                      Corey this post of yours is an excellent 'description' of how you interact with the Tableau UI. And how it doesn't work for you. Just to make sure we all understand you frustrations, would you please record a video of exactly what you're finding frustrating? (I think I know what you mean, but others might not.)

                       

                      Thanks,

                       

                      --Shawn

                      1 of 1 people found this helpful
                      • 8. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                        Corey Turner

                        Shawn,

                         

                        I don't have a microphone for my computer... but I'll try to do it from my Mac this weekend. I've got a ton of ideas on just little things that could be time saving or convenient. I'm actually adding one more shortcut to my ahk script now that will automatically save in-shelf calculations, so you don't have to drag it into the dimensions/measures area. It doesn't save a lot of time, but it's something I think would be handy. I like shortcuts -- they are fast!

                        1 of 1 people found this helpful
                        • 9. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                          Rajeev Pandey

                          Dear Corey,

                           

                          Would you explain how we can use this script because I am having no idea how to use this great script

                          1 of 1 people found this helpful
                          • 10. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                            Corey Turner

                            Rajeev,

                             

                            You will need to install a program called AutoHotKey. Once that is installed you can double click the .ahk script to run it.

                            2 of 2 people found this helpful
                            • 11. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                              Rajeev Pandey

                              Thanks Corey.Appreciate your help

                              1 of 1 people found this helpful
                              • 12. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                                Tyler Garrett

                                This is a very very fun topic.
                                ----Update: I use Keyboard Maestro now, it's much more user-friendly - this here looks scary. I've grown up a little to understand that user-friendly wins and AHK is cool when you need it. Keyboard Maestro would be a much better solution - Updated 7/7/2017 by Tyler Garrett

                                 

                                Corey, this is absolutely great. I do have a question, I'm interested to know why you replaced alt+a+c with another 3 button combination? I've done this on other apps because it felt more natural, habit from Counter Strike days maybe?

                                 

                                Just landed in a similar boat, will be releasing all the source code of an "arcade style" for common steps generated.

                                 

                                Below I'd like to share similar to what you're doing. I was thinking along the lines of ONE CLICK WIN button. I love it.. maybe it could be a different super relevant scenario.

                                 

                                Need to generate a few hundred calcs, high risk of error with tools available, and been thinking, might as well just script all of it. I like the direction you're going, one big mention--- I see the intro controls can often JAM UP the logic later in the script, here's a little knowledge transfer for those passing through. How did you handle the initial release of the "new" keys, and then your app releases all the fresh code? I ended up getting around it with being logical about the literal button and also "hopefully it works" a catch to WAIT if the end user hasn't released the original buttons...

                                 

                                I'm using Sendmode Input, as it can be more reliable for key strokes. "for sure" clean way to make sure everything fires off. Below quote explains keystroke delay time global set, which is pretty great once you realize all the limitations with the default send mods.

                                 

                                sauce

                                "SendEvent [v1.0.43+]: SendEvent sends keystrokes using the same method as the pre-1.0.43 Send command. The rate at which keystrokes are sent is determined by SetKeyDelay. By default, Send is synonymous SendEvent; but it can be made a synonym for SendInput or SendPlay via SendMode."

                                ;semi colon is COMMENT OUT, double dash -- is a comment out in stand sql syntax, so in notepad ++ this looks great because it will catch comments as sql comments, YW!

                                 

                                ;--...Some code that generates a calc, titles it, and tabs down to paste a calculation , z1 & z2

                                ;--...your header

                                z1 = your calc logic, you dont need anything crazy around this, it will simply zap it in there. send event does this "INSTANTLY", other mods TYPE IT OUT, extremely slowly...

                                z2 = your calculation title

                                Sendmode Event ;--...after many hours and hours of debugging, sendmode event stole the show and just KEPT working.

                                SetKeyDelay, 300,500 ;--...long story short with sendmode event, it plays well with Tableaus software/computer delay, and as you begin making these scripts, "Sleep, 1000" all over the place to get the timing of keys down is just not good.

                                ;--...your input macro

                                BlockInput On ;-- a means of keeping end user from being able to click off, type things, etc... send event (if i recall correctly) allows for good send controls because it holds all incoming traffic until the portion is complete (aka Return)

                                  Send {LAlt down} ;--left alt

                                  Send {a down}

                                  Send {a up}

                                  Send {c down}

                                  Send {c up}

                                  Send {LAlt up}

                                  Send, %z2%

                                  Send {Tab down}

                                  Send {Tab up}

                                  Send, %z1%

                                  BlockInput Off

                                Return

                                !F7::KeyHistory ;--I'd recommend always having a at the end, this can help explain what's going on in the back end. I like alt+f7, you can increase the amount captured by your script if you "#KeyHistory #" in your header - No double quotes.

                                 

                                For those getting into it first time::: I recommending using the "AutoHotkey Help" and start from the beginner tutorial. If you're really good at calcs in Tableau, or getting good at it, it can be right up your alley, if you just focus on the core concepts before jumping super deep.  If you've been programming, it's very straight forward, and if you just hack around in code - it's a very fruitful adventure and you will find this easy.

                                 

                                Tips::

                                1. capital letters matter most of the time, except when using %variables% -- lots of little corks in the notes, as you begin to debug.
                                2. lots of the code will run, even though it doesnt work at all.
                                3. if it's not working correctly, do everything you can to simplify it first.
                                4. maybe you want to do 5, or 6 hotkey macros/mouse movements, but a few don't work, avoid doing it all at once, it becomes impossible to debug, keep it extremely simple, then add the complexity.
                                5. go find a community posted source code, read it, copy and paste code.

                                 

                                GIF.gif

                                This gif shows the below screen shot of code in usage. The gif doesnt show me press 1, but it is being pressed, gifcam isn't perfect.

                                Because this application can be absolutely toxic to your end user experience on your computer (joking, but seriously be careful what you download and use, not to scare you, just a warning), I recommend you don't have any production reports open, nothing you care to lose, or BOSS instant msg convo you care to accidentally send a calculation or dive into some menu on a random application you didn't mean to do... Because of that, I will just paste my current beta version, keeping the copy pastes very much "you're accountable"

                                 

                                Cheers Fam!

                                Tyler Garrett
                                https://dev3lop.com

                                2 of 2 people found this helpful
                                • 13. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                                  Corey Turner

                                  Holy cow, this is intense!

                                   

                                  Glad you like the script. Why not just copy your calcs from another workbook? You can copy and paste more than one at a time. Just a thought.

                                  1 of 1 people found this helpful
                                  • 14. Re: Anybody want more keyboard shortcuts? Here is an AHK script
                                    Tyler Garrett

                                    Update: I use Keyboard Maestro now, it's much more user-friendly - this here looks scary. I've grown up a little to understand that user-friendly wins and AHK is cool when you need it. Keyboard Maestro would be a much better solution - Updated 7/7/2017 by Tyler Garrett

                                     

                                    These calcs had not been generated, all were new calcs due to having to peel apart a "Measure Swap" across 4 sources. Copy and paste into the workbook is my absolute favorite 'time save' when it applies, good point to add here in case some one is passing by!

                                    GIF2.gif

                                    ...

                                      Send {LAlt down}

                                      Sleep, %s3%

                                      Send {a down}

                                      Sleep, %s3%

                                      Send {a up}

                                      Send {c down}

                                      Sleep, %s3%

                                      Send {c up}

                                      Send {LAlt up}

                                      Sleep, %s3%

                                      Send, %z1% ;--calc title

                                      Sleep, %s3%

                                      Send {Tab down}

                                      Sleep, %s3%

                                      Send {Tab up}

                                      Sleep, %s3%

                                      Send, %q1% ;--calculation

                                      Sleep, %s3%

                                      SendEvent {Click}

                                    ...

                                     

                                    SendEvent Click + mouse move appeared to throw the mouse off of the OKAY button (for the first 5 calcs), wish there was a short cut for this OK button...?.. and to close the calc???? alt+escape button???? Anything is better than nothing and having to move my mouse to click it.

                                     

                                    So the script above opens the door for end user hovering over the OKAY button. Apply this to an array for z1 & q1, and don't move your MOUSE! Works great.

                                     

                                    Working with some people at ahk community forum to understand more on array usage and why the MOUSE movement breaks "only in the beginning of the script" after calc 4-5 it catches up and then the mouse drives itself, def a better more dynamic solution.

                                     

                                    Looking to blog more on this in the future. Now I'm working on ahk building visualizations. Shouldn't be too tricky, now that the hard part of figuring the syntax out is 'somewhat' behind me.

                                     

                                     

                                    Cheers!

                                     

                                    TylerG

                                    Dev3lop.com

                                    1 2 Previous Next