Welcome to MTurk Crowd

Work on Amazon Mechanical Turk, learn from the best, and have fun doing it. Join the crowd today!

Sign Up

Keyboard Maestro, an old hope for Mac users

Discussion in 'Userscripts, Extensions, and Software' started by DjBonadoobie, Jan 14, 2016.

  1. DjBonadoobie

    DjBonadoobie
    Expand Collapse
    DOUBLEWAT

    • Contributor
    Joined:
    Jan 12, 2016
    Messages:
    342
    Likes:
    1,030
    As probably everyone has heard of AHK for PC users and it's positive effect on mTurk tasks, there has been a glaring information hole for anything useful for Mac turkers as far as scripts and macros programs. But there is a hope for those users who solely use mac, prefer to use only mac or are just turned off by the idea of having to dual boot their machine with Windows just to be able to use AHK while turking.

    The solution, Keyboard Maestro. This is a macros program that is available for free download (trial version with full functionality) from the site linked in the previous sentence (duh). In case you're completely new to this and have no idea what "macros" is(are?) here is my laziest definition ripped from Wikipedia.com

    "A macro (short for "macroinstruction", from Greek μακρο- 'long') in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure."
    Source: https://en.wikipedia.org/wiki/Macro_(computer_science)

    Okay, so what does this mean? To put it simply, it's a way to automate repetitive tasks on your computer. For better reference I'll illustrate an example from the actual program.

    This is one of my favorite Macro(instructions) that works on a number of different types of HITs on mTurk. This one is from a specific Kevin Dodds scripts I made on Keyboard Maestro...

    [​IMG]

    So what this macro allows me to do is when I found the phone number in another search window that I want, all I have to do is left-click on the phone number with the "alt" modifier key pressed then the macro will triple click wherever I clicked, copy, move back to the HIT window, tab down to the correct text field and paste the number. This saves about 4-6 seconds per HIT.... so what? So this is just one macro that I have for this HIT, and with each one saving a couple seconds, I can effectively knock off 20-30 seconds from these HITs....

    So there is an example and little definition of Keyboard Maestro and Macros and how Mac users can take advantage of it on mTurk.

    Here are some helpful links and highlights from the official KM documentation:

    The Document

    On Triggers and Hotkeys (or any other way you wish to initiate a macro)

    Macro Actions

    Example Macro Actions

    The Keyboard Maestro Forum is also a great resource and place to ask more in depth questions.

    A few more tips

    Application Specific Macro

    Here's something that has become incredibly useful to me and saved a lot of headaches...

    When creating a Macro group for a certain HIT you can specify it to only be active in a certain application. For example, I do HITs in Chrome almost exclusively while I use FF to run panda's/Scraper and I use Opera browser for email/forums etc.

    So, it can be a huge pain in the ass when you have a Macro assigned to a Hotkey like the letter "f" for example. I don't want to have to turn off the macro every time that I want to type something in the forum or whatever, but if I don't then I may type "f" and set off some crazy Macro that completely fucks up my flow.

    Solution:

    When creating a new Macro you are presented with this screen (I named this "New Macro")

    [​IMG]

    Now click "Available in all applications" then "Available in the following applications" (note the other ways to specify as well)

    [​IMG]

    Then select whatever app you want the Macro to work in (you can choose multiple apps if you want)

    [​IMG]

    This feature is always available, not just when you are creating a new Macro.

    I highly recommend using it

    Execute Javascript

    This is one brand new (to me) but omg I'm lovin' it, I can't believe it took me this long to discover this feature.

    Within any macros you can add the "Execute Javascript" action. There are a couple different options for this and a multitude of ways to specify and achieve exactly what you want... so for simplicities sake I'll show the first one I made.

    I wanted a way to grab a url address and copy it to clipboard without having to use a multitude of keyboard shortcuts to achieve it. Utilizing javascript works excellent in this instance.

    First I set up a new macro with a trigger (I chose to use a hot key, but that's up to you) then search "Execute". The list of options should now look something like this...

    [​IMG]


    Right. So now, I would prefer to encapsulate this javascript in an "If Then Else" . For the function I'm going to use this doesn't need to be done necessarily, but since I am using a js function this is something that could come in handy later when I want to make updates on it or further specify the parameters.

    Next I'm going to select the "Execute a Javascript in Google Chrome" (note: the other options, safari and automation). I throw that in my "if" box and get this (note: I also de-selected the else option, because I have nothing else to execute at this time)

    [​IMG]

    Alright, I'm gonna kind of jump ahead here and assume that if you're messing with this you know at least some javascript... next I throw in my function of choice, which for this one I want to grab the url of a window I use for searches... then I adjusted some parameters and check "Save to System Clipboard", and now I got this bad-boy

    [​IMG]

    I've briefly tested this in Chrome only so far, but it works great. It's way faster than my other method (I'll illustrate below), more accurate, requires less CPU and works in messenger windows. This was the way I was achieving the same affect (which does not work in messenger windows).

    [​IMG]
    ( my use of "Escape" is to stop the current page from loading to increase speed of function)

    So that's a quick run down, and as far as I've taken this feature so far. But now I'm very excited to see how else I can apply it! Could be used to open links, select radio buttons etc. etc.


    Please feel free to comment, ask questions or share this thread as you wish!!!!
     
    Collapse Signature Expand Signature
    #1 DjBonadoobie, Jan 14, 2016
    Last edited: Jan 14, 2016
  2. coffeeowl

    coffeeowl
    Expand Collapse
    taking notes

    • Contributor
    • Crowd Pleaser
    • HIT Poster
    • Master Pleaser
    • Mentor
    Joined:
    Jan 12, 2016
    Messages:
    23,834
    Likes:
    52,577
    Mac user here too. Will def be studying this in depth today. Thanks!
     
    Collapse Signature Expand Signature
    DjBonadoobie likes this.
  3. DjBonadoobie

    DjBonadoobie
    Expand Collapse
    DOUBLEWAT

    • Contributor
    Joined:
    Jan 12, 2016
    Messages:
    342
    Likes:
    1,030
    You're welcome! This has been a total game changer for me. If you have any questions feel free to ask here or you can pm me too if you want :)
     
    Collapse Signature Expand Signature
    coffeeowl likes this.
  4. magnificat

    magnificat
    Expand Collapse
    New Member

    Joined:
    May 11, 2016
    Messages:
    11
    Likes:
    3
    Thank you for this post I'm sure it will be very helpful to me once I learn the basics of coding and such. I'm just not sure where to start. Do you have any suggestions? A good youtube channel? Do I need to learn coding and scripting?