Automatically choosing variable value one after another from given values

I am trying to build workflow for social media posting.

I would have 3 times of the day (For example, 1 pm, 7 pm & 10 AM) on which I would like to make a post.

Each time I run my Macro, it should automatically choose the next time of the day (or next day, depending upon the time). How to do that?

[P.S.- Can't choose time of the day trigger as I need to type in the times on the website to schedule the posts on that times.]

https://wiki.keyboardmaestro.com/trigger/Time_of_Day

Thanks for the response.

The time of day only plays a role only of an example here. Although I'm going to post at specific time of day, I would be scheduling my posts for which I need to type in timings on the website.

As the timings are going to repeat, I am wondering if I can automatically make macro type in time of the day from the list of specified times, one after the other.
Each time I run macro, it types in the next time slot.

Oh, no periodical? Then you should find other way to achieve your goal.

You need to define "next time", which isn't clear from the context. Is it the next time slot after the macro is run? Or do you want this run of the macro to pick the time slot after the one it used last time it was run? Something else?

The first is a simple time calculation, the second will require you to store data in a way that persists (global variable, dictionary, text file on disk...), the third... who knows?

Thanks for the response.

Sorry for misunderstanding. I meant the second one.

How do store data in a way that it persists?

I am a non-technical person and it's been a month that I started using KM. I could google things out (global variable, dictionary, text file on the disk etc) but if you could give me a proper direction, it can save lot of my time.

And I would like to LEARN how to make such a macro rather than having a macro or script handed over.

If you look at the "Variables" section of the manual you'll that the only truly persistent (permanent) type is a "Global variable". That's probably enough for your needs, but at the other types so you know the differences.

The first thing I suggest you do is write down your workflow. Imagine you are sat there, arms crossed, and explaining every step to someone else who is controlling the computer. Once you've done that, have a look through KM's "Actions" to find the one(s) corresponding to each step in your explanation -- some will be obvious from their name, others not so until you dig into their (many!) options. If you can't find what you want -- ask! KM Actions can do a lot, but sometimes you have to step "outside" and use an AppleScript or similar.

If you get stuck -- and we all do -- then post the outline of your workflow, the macro you've got so far, and an explanation of where you are having trouble. The people here are very helpful!

Kudos for that. I've a feeling you've picked quite a complicated macro to start your journey with! But if someone does post a complete solution you'll still be able to learn a lot from dissecting the macro they provide.

I am not feeling like giving up yet :sweat_smile:

I guess I'll find something on the forum

Thank you so much.

And look what I found

I'll dig deeper into this.
And few other posts too here on the forum. :blush: