Need advice on how to automate installation steps and recording them (marked asciinema as correct answer)

I am a web developer by occupation. I want to write how-tos on certain programming stuff on the macOS such as running certain commands in Terminal, etc.

because things change rapidly, i want to automate the how-tos so i can test them more quickly. I also want the steps to be recorded on video as well.

So i want to automate the how-tos and the recording using Loom (but i am open to use other software).

I am on macOS v12 (monterey) and am going through robotframework (a Python open source RPA) but i realized i still need osascript or applescript to help me as robotframework cannot directly talk to macOS.

A typical use case might be to activate terminal, type env wait 3 seconds then execute it thereby showing the output and then quitting terminal.

From there i have googled and discovered Sal Soghoian’s work. I have reached out to him over email and from his websites, i discover so I joined.

My questions are:

  1. narrowly speaking, for the above use case of opening terminal, type env command, wait 3 seconds, then execute it. then quit. WHat should I use to automate? Can it be something that works with robotframework?
  2. what can i use to record the steps happening in 1 as video and in an automated way? i.e., i run a script and that script will run through the steps in 1 and record them at the same time.
  3. generally speaking, what should i use? applescript, omni-automation, javascript, typescript? the choices boggle the mind.

Asciicinema might suit your needs?

1 Like

oh that’s very cool. never learned of that before. I suppose it doesn’t record anything outside the terminal.

what about question 3 in terms of general automation for the macOS ecosystem?

AppleScript generally has the most resources for automating the Mac.

any recommended resources for learning applescript? i did come across a 2009 ebook abt apple script by sal soghoian. not sure if it’s sufficiently up to date. i don’t suppose you know if robotframework can effectively call applescript?

No sorry. I’ve never taken the time to learn AppleScript. Just hacked together from other scripts online.

On the robotframework, I’ve never used it so I can’t really say. But, from a brief look through it looks like you’d have to implement your own glue code.

1 Like

I think, if I were to try to do this. I would avoid scripting things altogether.

I’d probably create a package.json run script which runs the asciicinema and then in the background actually runs the script. Then I’d use Selenium or Cypress to automate things in the browser.

1 Like

AppleScript documentation on Apple’s website is the comprehensive guide.

But for the most part, you can get a feel for AppleScript, and learn quite a lot, even from quite old material. The basics haven’t changed much.

The biggest challenge with AppleScript is that it’s idiosyncratic. To use it like you’d use javascript or python, you not only have to know the language reasonably well, you’d have to also understand how the apps you’re scripting implement it.

Most people start by using existing AppleScript code and then modifying it for their purposes. I would guess most of us never get much farther than that. I never have, really, despite multiple attempts to learn it over the last couple decades. And while I’m not a professional programmer, I’ve gotten decent in a number of languages over time (Tutor, Apple Basic, PHP, Python, now a little lua and javascript); AppleScript has always seemed just out of reach.

So AppleScript is the right tool, but it may be a challenge to do something comprehensive like you’re talking about.

1 Like

Thank you. I think i will mark the asciinema answer as the correct solution. I experimented with it yesterday and it helped.

I will look deeper into apple script for sure

i don’t know how to mark your reply as answer but it was the right one for my narrow specific use case. the greater issue about apple scrpt vs typescrupt etc i am still exploring. Thank you!

For what it’s worth, I don’t believe that there is currently a way to do that. Discourse (the forum software being used here) is generally more a traditional sort of discussion forum rather than those you would find on support sites (where you mark an answer as best … which then becomes outdated as best is rarely best forever) or upvote Q&A sites (like Stack Overflow). Being a more discussion-based forum setup makes sense as it is a forum for a community that has formed around the podcast, and not purely a tech/product support or domain-focussed Q&A site.

1 Like