Member-only story

Apple Script Observations

Jay Wilson
2 min readOct 30, 2019

This post is going to cover some observations about using AppleScript.

This is going to be a fairly informal post since it’s my thoughts and observations.

Variables… where are they declared?

I was a bit confused because variables are not declared any one.

In Swift, variables are always declared before they are used.

var name: String // or use type inferencing
var name = "Maegan"

In AppleScript to declare a variable the command is set var_name to "var_value". I realized I wanted all my variables to be declared in a central place while working in AppleScript, but I couldn't really do that.

AppleScript is very human readable

AppleScript is completely human readable. A lot of the commands are made to be read. Here are some examples:

  • To declare a loop, it is a repeat command.
  • To break out of the loop, it is a exit repeat command.
  • To make an application do something, use the tell command

To me, these are very human readable.

There are no brackets!

While the commands are human readable, the nesting of code is not as human readable. There are no brackets and ScriptEditor.app does not have guides so the nesting can be hard to follow.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Jay Wilson
Jay Wilson

Written by Jay Wilson

I like to solve problems using Swift, make YouTube videos, and take photos. I also really enjoy a good cup of coffee.

No responses yet

Write a response