Which scripting languages are best to learn for Imaging scripts

jmltapp1971
New Contributor

Hi

We are starting the process of implementing Casper Suite at our largely Windows based business. At this time we have a number of Macs out in the wild and are looking to bring them under control, plus offer a range of Macbooks to certain departments.

We currently use SCCM to automate our PC updates, deployments and packaging and are very comfortable with scripting for those item. However with the move to Apple we are now faced with the task of deciding which scripting languages are best for us learn and progress with when trying to provide a degree of automation outside the scope of Casper.

Anyone have any recommendations as to the most useful languages for us to start learning so we are not totally in the dark.

Many thanks

Jason

12 REPLIES 12

chriscollins
Valued Contributor

This can be different't for different people, and there is always a better tool for the job (personally, if I can, I love to write things in Python if it is the best tool) BUT, the most versatile language to really start with is shell scripting. Learn how to script Bash and learn the command line well. Then go from there to whatever is most appropriate.

davidacland
Honored Contributor II
Honored Contributor II

My personal preference is still bash. It rare that I'm faced with a challenge that I can't overcome with it, although I'm sure the same could be said for others.

AppleScript is useful if you want to interact with the user, or manipulate graphical items. I use it a lot if I want the user to enter a password, select a folder or something like that.

I've seen lots of Mac admins using perl and python these days.

There's a nice response to a similar question on this thread http://superuser.com/questions/414965/when-to-use-bash-and-when-to-use-perl-python-ruby

jrippy
Contributor II

+1 to bash scripting. Python is great too - almost as powerful as Perl without much of the headache, but start with bash.

hkabik
Valued Contributor

Bash Scripting and to a lesser degree AppleScript have never failed me.

jmltapp1971
New Contributor

Thanks for the help guys - Time to peruse the book lists over at Amazon and pick some reading material on Bash.

stevewood
Honored Contributor II

A great online resource that has been mentioned many times here is the Bash Guide:

Bash Guide

davidacland
Honored Contributor II
Honored Contributor II

We've got quite a lot of Mac solution specific bash tutorials on our https://www.google.co.uk/search?client=safari&rls=en&q=amsys+blog+bash&ie=UTF-8&oe=UTF-8&gfe_rd=cr&e.... They're covering some of the particular scenarios we've come across over recent years where a bash script has helped.

Some of them are consolidated into a single guide: http://www.amsys.co.uk/blog/essential-guide-bash-scripting/#.VVEYUWB7Urk.

gachowski
Valued Contributor II

We are all going to need Python, some setting that we were able to set with .plist are now only able to be set with CoreFoundation framework. : (

https://managingosx.wordpress.com/2015/02/02/command-line-tools-via-python-and-cocoa/

That said to for starting bash....

C

cdev
Contributor II

Start with Bash, combine with CocoaDialog for GUI interaction – way easier than implementing AppleScript as well, especially if it's a simple user-input dialog. Then look at Python once you have your shell basics down; much better for more complex things (the code is much simpler/cleaner).

bpavlov
Honored Contributor

I'm not saying CocoaDialog doesn't have its use, but hasn't that pretty much been abandoned for a couple of years now? The last stable version is from 2006, the last dev version is from 2012....

Anyways, my two cents: Bash, AppleScript, and Python.

nessts
Valued Contributor II

I vote for any shell, and then graduate to perl I suppose that makes me old and Cocoa Dialog, yeah its old, but now with the lame graphic look of 10.10 its back in style, and it works for displaying information and getting information from the users much easier than apple script.

Simmo
Contributor II
Contributor II

I prefer Applescript for displaying info or user input, I find it to look slightly nicer and Apple may well break CocoaDialog at any point in the future, which would then require you to re-write all CocoaDialog in to Applescript. Saving a headache from later down the track.