[Discussion] Shell based VS GUI based automations?

I myself actually much prefer using the shell for automation, for the most parts, it allows me to hard my shell scripts to my server, as they either run some Linux distro (not GNU/Linux, I don’t use many GNU tools and don’t approve of the GPL) and my NAS runs FreeNAS - a FreeBSD deriviative - and the shell is so immensly powerful!

Before you ask, I use fish, because it’s to me the most fun shell out there.

What tools do you use for automations? Is the shell included or are you full out using a GUI like workflows and automater?

  • Bastian, the crazy *nix guy :smiley:

On a side note, I also happen to find the shell super easy to program against, with libraries for Swift as well as other languages!

1 Like

For the most part I stick to Bash and Python for automation. They’re fun, easy and free. The only time I use a GUI is for stuff that requires .plist files on Macs. This is mainly for having a script repeat at certain times (like cron). I use automator and a script to go to where I have my stuff written and run it. I’m just not interested in learning .plist/xml syntax.
Also, I use rsync instead of Time Machine in conjunction with a bunch of bash scripts to backup my setup in the shell (including brew formulas, python modules, etc.) There’s an option to run an automator script on change to a folder which I have pointed to the /Volumes folder.
I also have a few services that are with AppleScript/automator. Most important one is Copy Path on finder files/folders and open a new Terminal tab here.
Finally, there are scripts I like to run often but don’t necessitate an alias or automated option. So, I create a Alfred workflow to call the script and pipe stdout to a notification or large type.

As @dustinknopoff, for me, this is not an either/or question. There are many automation tools for Macs, and they can be used and combined as needed. For example, I use Keyboard Maestro, AppleScript, shell commands called from AppleScripts, and macros written in Nisus Writer Pro’s macro language, all chained together, sequentially performing parts of a larger workflow. Automation on the Mac is a rich environment, and if something can’t be accomplished using one tool, there’s a raft of other tools to consider. I do wish that there were better tools for creating GUIs with scripts, however. Any suggestions?

Yes, same here. I use pieces of Applescript, bash or python code to do certain tasks in Hazel, Keyboard Meastro, Automator or an AppleScript program.

For creating dialog windows, that can do more things than the standard AppleScript dialogs, I use Pashua. These dialogs can also be used in Bash scripts, JavaScript, Perl, PHP, Python, Ruby, Tcl and others.

Thanks, @FrankV.

Pashua does not include the control that I need, which is a scrollable list of strings that would mimic the scrollable list in AppleScript’s “choose from list” dialog. (The problem with this dialog is that long strings in the list, such as, “This is a long string that has a lot of characters” are displayed as “This is a long string that…characters”.) According to the developer, this control has no equivalent in the Cocoa framework. I ended up using a pulldown, which works, but it is not ideal.

I cannot use XCode or Swift to develop a custom control and use the scripting bridge to display a dialog (if I could even learn all this in the first place, OOP is not my thing) because XCode and Swift are available only for the current version of macOS, which I never upgrade as they become available, but only (if at all) after several point releases and security updates.

How strange it is that there are so few options to create dialogs when using AppleScript.

1 Like