Posted on 05-11-2015 01:06 PM
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
Posted on 05-11-2015 01:19 PM
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.
Posted on 05-11-2015 01:21 PM
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
Posted on 05-11-2015 01:36 PM
+1 to bash scripting. Python is great too - almost as powerful as Perl without much of the headache, but start with bash.
Posted on 05-11-2015 01:53 PM
Bash Scripting and to a lesser degree AppleScript have never failed me.
Posted on 05-11-2015 01:57 PM
Thanks for the help guys - Time to peruse the book lists over at Amazon and pick some reading material on Bash.
Posted on 05-11-2015 02:01 PM
A great online resource that has been mentioned many times here is the Bash Guide:
Posted on 05-11-2015 02:03 PM
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.
Posted on 05-11-2015 03:40 PM
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
Posted on 05-12-2015 06:24 AM
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).
Posted on 05-12-2015 07:11 AM
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.
Posted on 05-12-2015 07:18 AM
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.
Posted on 05-12-2015 08:41 PM
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.