Posting to Twitter

TL;DR: Looking for the fastest, most robust way to turn a line of text in my editor into a post via the Twitter app.

I run a Twitter account that posts real-time stats about baseball games. For years, I've interacted with my audience using an open-source command-line app that let me send posts to Twitter directly from Sublime Text, my text editor, using a shell script.

You might know what came next. Twitter's infuriating new policies have drastically limited API access, unless you're willing to spend $5000+/month for the privilege. That's not an option for me, as my account is just an avocation, with no income generated. This weekend, the command-line tool I've long relied upon no longer works.

I've crafted what I think may be a clunky solution with Keyboard Maestro (screenshot below). Accessed through a hotkey, my macro copies the current line of text from my editor, switches to the Twitter desktop app, pastes the line of text, and then posts it by sending a Control-Enter key combination. Through experimentation, I found that I needed about a total of 50 hundredths of a second delay, here and there, to make this all work.

And it does work, but I know that, despite years and years of experience with KM, I barely scratch the surfaced of its real power. So, I wanted to pick some smarter brains than mine about best practices for this kind of application. Is there a better approach that the one I'm taking?

Thanks for reading and for any thoughts.

-- Robert

Post to Twitter via App.kmmacros (8.1 KB)

I would suggest that you share your macro so others can see what you have already. Maybe your approach is the only approach, but looking at your macro may help others tweak it to perform better?

And all I can say about "scratching the surface of KM" is that in just a few months of using it, is that all the time you spend learning about it is just an amazing investment for yourself. You learn the app, you save time and work, you end up learning other languages, math, etc. At least, that's my experience so far so I would totally recommend that you experiment with it whenever you can, on a regular basis :slight_smile:

1 Like

Great points, both, @iamdannywyatt. I've edited the post with a picture of my macro.

1 Like

Share the macro itself. It will be easier for others to modify it, if necessary, and upload it.
Assuming you don't know how to:

Make sure that the MACRO is selected, otherwise, if an Action inside the macro is selected, it will share the Action, not the macro :wink:

1 Like

Ah, got it. Fixed the post. Thanks again, @iamdannywyatt.

1 Like

My pleasure! :slight_smile: Glad I could help!