Looking to learn how to write apple/shell scripts: any pointers?

macOS & Mac Apps

Hi all,

It's Joseph here again. I'm looking to learn how to write apple and shell scripts. Are there any good resources that you guys would be willing to give me for getting started with this? I eventually want to make some scripts that'll work with VoiceOver.





Submitted by Chris Norman on Saturday, May 23, 2015

That entirely depends on what you want to do. First you need to figure out if you mean shell scripts, or apple scripts, as there's a marked difference:

* A shell script is run from within the shell. It uses terminal commands bound together to do interesting things. You can make shell scripts on OS X and Linux, while Windows calls them Batch Scripts.

* An Apple Script is a script written in Apple Script, and compiled using the Script editor found in your mac's Utilities folder. You use it to tell various applications to do various things.

So, if you're wanting a utility script to do something useful, but without pretty printing it's probably a shell script you want.

When you say you want to make some scripts for use with VoiceOver, what do you mean by that?

I've written a bunch, and honestly, the starting point was hitting up google with something like:
How to do x in apple script
Where x is the action: Tell the time, write an email, hack into the Pentagon.

Once you've done that you can figure out what others have done, and you find some cool things out along the way.

If it's more deep-level programming you're looking for, then you've got a plethora of languages available to you, starting from C and C++, Swift, Objective C, Python, Ruby, PHP, JavaScript. Obviously what you want to do largely decides what language you use... If you want to write websites, C++ is a poor choice. If you want to write a kernel, PHP is a poor choice.

To get started, hit up google with something like
Getting started with apple script
Getting started with shell scripts

Hope this helps, and sorry I went on a little.

Take care,

Submitted by Joseph on Saturday, May 23, 2015

No worries. I'll definitely give google a look for that. Thanks.

Submitted by JDawg on Monday, May 25, 2015

I'd like to learn about applescript though. any good startingpoints, besides google? I found a thing from 2009. has it changed a lot since then, or can I go on that?