Using AppleScript for workflow automation on Mac

Using AppleScript for workflow automation on Mac


I see a lot of people talking (or writing) about workflow automation on Mac OS X. Most of them (almost all) talk about Automator. In my opinion there is a much better way to automate your workflow on OS X. AppleScript. AppleScript is basically the technology underlying Automator. But instead of clicking and dragging and not understanding the Automator menus, you write clean code that does exactly what you want it to do.
Automated workflow using Automator
Take me for example. I like how Dropbox offered to upload my phones photos automatically. The second I hook up my phone, the photos are being imported into Dropbox -> Pictures -> Camera Uploads. After a while however, I realized that this was starting to take up much more space than I actually had and I kept manually moving the photos to a different location. For a while, every time I hooked up my phone I manually moved the pictures.
Of course, I wanted that to change. So I had a look at Automator. Automator in itself is pretty non-self-explanatory. I think it is supposed to be easy enough to handle without further introduction, but it isnt. At least not for me or the people I talked to. I just had a hard time finding what I was looking for.
I eventually found actions that after failing multiple times, did what I wanted them to do. I somehow connected them to the folder in question and it somehow worked. At least sometimes.
I dont know if it was a mistake I made, but the actions only worked about 50% of the time.
Automated script connected to folder
A while later I came across AppleScript. I knew it existed, but I never really thought about using it much. I did however eventually think about improving the file-moving experience. In retrospect I was stupid for not trying it earlier. Of course, it takes a while to get along, as with every programming language. But when you do, its a really powerful tool. It was basically quicker and cleaner to do the same thing with AppleScript than with Automator (look at the screen shots). You simply save the script, add it to the scripts in your Library (startup disk -> Library -> Scripts -> Folder Action Scripts) and attach it to your folder (right click -> Services -> Folder Section Setup...) and youre done. Works like a charm. You can also save it as an app and put it on your desktop or attach it to your Finder toolbar.
There are many different use cases and this is one of the simplest. I also created a little app that lets me resize the pictures in Evernote and there is no limit.
The AppleScript Editor that comes with every Mac also features a dictionary of Apps and your way to interact with them. It basically works like an interface or API. You should definitely give it a try.
What else could you do? Force yourself to keep your desktop clean by having a script that deletes all the files on it every Sunday or create desktop shortcuts to your favorite website or automatically adding files to a certain app once they are dropped in a specified folder or... I really dont think that there is much you cant do.

download file now

Popular posts from this blog

UTAUloid Voicebank Download Utane Uta Defoko

Using a Wii U Pro Controller as an Xbox 360 Controller in Windows 10