Today’s adventure was working with some simple Automator Workflows and AppleScripts to help Finder tasks in OSX.
FILE LOCATIONS
First it’s useful to remind ourselves where these objects go:
- User workflows go in ~/Library/Workflows/Applications/Finder.
- System workflows are in /Library/Application Support/Apple/Automator/Applications/Finder.
- User scripts go in /Library/Scripts/Applications/Finder.
- System scripts are in /Library/Scripts.
Various useful scripts can be found in these subfolders:
- Finder Scripts
- Folder Action Scripts
- Folder Actions
- Navigation Scripts
HOW TO MAKE A “START BUTTON” FOR OSX – really simple version
A copy of “New Applications Window.scpt” from /Library/Scripts/Navigation Scripts/ was moved to ~/Library/Workflows/Applications/Finder and then compiled and saved as “New Applications Window.app”.
An alias of this was then renamed to “Start” and placed on the desktop. Here is the script:
tell application "Finder" activate open folder "Applications" of the startup disk end tell
HOW TO CLOSE ALL FINDER WINDOWS
Another useful script is this one to close all Finder windows:
tell application "Finder" close every information window {} close every window {} end tell
To run your scripts, first you use the AppleScript Utility to enable the option “Show Script Menu in menu bar” for AppleScript. Then when you are in Finder you will get a drop-down context-sensitive menu which includes the system scripts as well as Finder scripts you have created yourself.
USING APPLESCRIPTS IN AUTOMATOR
Useful additional Finder workflows can be created by simply copying some of the sample AppleScripts into Automator “Run Applescript” workflow objects.
Once tested in Automator and saved, your workflows have to be manually moved to ~/Library/Workflows/Applications/Finder, but then they are available as additional actions when you are in Finder. To access them, you press the Control key and click mouse button 1 in a Finder Window (ylou can also use mouse button 2 if you have it). You can then click on “Automator” to see a list of workflows you have created.
I created workflows to open my Home, Documents, and Applications folders, together with others to create a new text file, to create a new sub-folder, and to provide an easy-to-use Finder navigation menu. The last one used “Open Special Folder.scpt” from /Library/Scripts/Navigation Scripts.
Enjoy!