Applescript is a great tool for us Mac users. It’s a scripting language that’s easy and simple enough to not scare away true beginners. A fun feature of Applescript is how to write code, since almost looks like regular English sentences. Applescript was the first scripting language I felt comfortable using. However, its ceiling of limits is pretty low. For some tasks it’s better to turn to other tools.
When jumping from the Applescript ship to Python, the water seems mighty cold. There is a lot more ‘computer code’ and all the commands are new and foreign. Plus, the language’s name is a type of snake! You’ll be feeling homesick for the ease of Applescript, but these feelings will pass.
Python’s developers wanted to create a language that was fun to learn and use, that’s why they named it after the British comedic troupe, Monty Python. And when compared to other languages, like C and Pearl, it is easy to pickup and learn.
Snakes In My Mac OS
Python is pre-installed onto your Mac, and you can access it in your terminal. Check it out by typing “python” in the Terminal window. You should now be able to play with some python code.
For a simple start, try:
2 + 2
which will give you the answer 4. Next, let’s assign some text to a variable. Type:
mytext = 'Hi World'
You should see your text appear. Let’s change the word “World” to something else:
mytext = mytext.replace('World', 'Mom and Dad!'
Your text should now be updated. Congratulations! You are now programing in Python.