Python or JavaScript as a general use language for automation

I think Automating the Boring Stuff with Python is quite specific, and not something that will give you a broader grounding in Python. Not saying it isn’t a good book, just perhaps not the best option for learning Python. Perhaps in combination with another book more geared to a broader introduction to Python.

Programming by Stealth is good, but is focused more on JavaScript for web than for automation (I’m very much enjoying Bart’s delve into Git on PbS at the moment).

JavaScript is becoming a lingua franca across apps and platforms, but Python I would say is going to give more options more easily on macOS given the level it can operate at and won’t require Node or the like to get to the deeper functionality with the OS. There is JXA, but if you’re comfortable with AppleScript, I don’t think you would get much benefit from trying to focus on that first - it can be hard to get into based on the levels of documentation and examples available; though if you search this forum you will find some.

For your use cases, I would suggest Python first, based on the code libraries and the amount of source code available, for working with the files and content you would want to automate against. I would say that it isn’t less suited to quick scripting. If you doubt that, try it for a few days and say how far you get. I expect you will be pleasantly surprised.

If you have particular apps you want to work with like Drafts, OmniFocus, Scriptable, etc. then JavaScript is absolutely where it is at. But, I think you’re more likely to get by with what others have done in the interim and dip into JavaScript for particular apps as you need to do something or once you have become a true Pythonista.

1 Like