Conversation

Fahim Farook

I had a Python script which would post a daily dynamically composed tweet to Twitter. That stopped working last week because something went wrong with Twitter’s API set up. The service came back a couple of days later but my old info was gone and registering again apparently did not fully work.

So I decided not to rely on the API service and looked around for an alternative …

One possibility was to use macOS Shortcuts to create an automated tweet. Most of that seemed fairly straightforward and I got a workable workflow, but on macOS, there is no way to run a shortcut on a schedule …

So I thought of coding a quick app to do the job. The job would compose the tweet with the dynamic bits set up in Swift and then pass the tweet content to Shortcuts to be used as input. The app would also handle the scheduling so that the shortcut is executed daily at a given time and give me some logs indicating how it all went …

Seemed simple enough and the basic implementation was pretty easy. The only fly in the ointment was that I decided to use a third-party library to handle the scheduling 😛

It was a great library. It had all the features you could think in terms of defining a schedule, but it also seemed to not quite work in subtle ways. I discovered this only after I’d used the new app for a couple of days and had to debug scheduling issues.

I ended up writing the scheduling part as a custom component which handled only the scenario I was interested in and not the everything-but-the-kitchen-sink approach. But using the third-party library did give me some great ideas about features to add to my own scheduler to make it (and the reporting) better 🙂

#Coding #Swift #macOS #Shortcuts #Automation #Scheduling
1
0
3
@atnbueno Thank you 🙂

I did find Shortery when I was searching for a solution before coding my own. But the features I wanted required the premium/paid version and since I only want this for a one-time thing, paying for the functionality didn’t seem viable. So I coded my own quick-and-dirty solution instead …

But if you do want multiple shortcuts to run on a schedule, I agree, Shortery looks great 🙂
0
0
1