How do I auto-generate an Apple Script?

Are you stuck in a situation where you need to automate a UI flow in Apple Script, but losing sleep over figuring out how exactly you can do it? This blog post might just make your day! 

Automator to the rescue! Apple's inbuilt tool called Automator can allow you to create GUI based workflows, and you can use the output from the Automator recording to create your Apple Script! More information on Automator can be found here.

Here are the steps to create an automated applescript:

  1. Launch the Automator

  2. Select a project type, I chose type workflow

  3. Hit the record button

  4. When the recording is on, start creating the UI flow just like how you would do manually.

  5. Stop the recording, and check out the Watch Me Do section. Image shown below.

  6. Now, select all of this, copy and paste it in the Script Editor and Compile it. Image shown below.

Your auto-generated apple script!

Voila! You have your Apple Script ready! 

Motivation for this blog was received from: https://apple.stackexchange.com/questions/315086/applescript-ui-scripting-and-click

I hope you learned something new! ☺️

Previous
Previous

How to rename a git branch?

Next
Next

How to gather information about the UI elements for apple scripting?