Categories
Uncategorized

OS X Finder Shortcuts

Update 9/29/2018: The scripts no longer work as-is on macOS 10.14 Mojave. If you’ve already installed them, you will receive the error, Not authorized to send Apple events to Finder. (-1743). A workaround is to open each app in Script Editor, copy and paste the code to a new script, and save new apps (doing this will not retain the icons, which will have to be transferred to the new apps). After doing this, launching the new apps will prompt you for permission to run. If you haven’t already installed the apps, you will receive a “Program is damaged…” message when trying to load the application in Script Editor. The workaround steps from the 1/27/2014 update below are no longer applicable, since the Anywhere option is no longer available in the security settings. This can be altered by running sudo spctl --master-disable to temporarily disable Gatekeeper before initially launching or editing the apps, and then sudo spctl --master-enable afterwards to turn Gatekeeper back on. However, even after doing this you’ll still have to use the workaround for the -1743 error described above. It would probably be easier to create the apps from scratch using the source code and icons below (be sure to export the scripts as apps using Script Editor).

Update 1/27/2014: Depending on your version of OS X, you may have to hold down the command key before and during dragging the icons to the Finder toolbar. Also, on OS X version 10.8 and newer, opening the programs may not work, instead displaying a message that “Program is damaged and can’t be opened. You should move it to the Trash.” To prevent this from happening, open Gatekeeper settings located in System Preferences > Security & Privacy. Make a note of the current setting for Allow apps downloaded from:, and then change it to Anywhere and confirm by pressing Allow From Anywhere. Once each of the programs on your toolbar has been successfully launched, they no longer go through Gatekeeper. You can restore Gatekeeper settings to your original option noted earlier.

Update 3/4/2012: The zip file now includes the updated version of the muCommander launcher (see comments).

I have uploaded a bunch of AppleScript scripts that I have found useful in OS X’s Finder. They are described below. They were saved with the .app extension. I believe that I did this so that the icons would appear correctly in the Finder toolbar.

I recently started using OS X after years of using Windows and Ubuntu. Over the summer, I purchased the MacBook Air. I had not used OS X very much in the past, but I liked the idea of having a sleek user interface on top of a Unix-based OS, which would have tools that I’m familiar with from Linux (or if not, would be available). Additionally, two software packages that prevented me from switching from Windows to Linux in the past were available for OS X, Adobe CS and Microsoft Office. Also, there was no PC laptop that was as thin and fast as the MacBook Air. I believe this might have changed with the new Ultrabooks that have been released recently.

Anyhow, after a few months of using OS X, I have accumulated a few Finder scripts that I have found useful. I downloaded some of these that were already available (and possibly modified them) and wrote the ones that I couldn’t find. The image below shows the shortcuts to these scripts in my Finder toolbar.


The list below describes each script, in the order that they appear in the Finder screenshot above. Click the titles for the source code.

  •  Create New File (attribution in source)  I found this on the internet. This creates a new empty text file in the current directory. I sometimes prefer to create a file, and then open it, as opposed to using a text editor to save a new file. For example, if I’m working on a project and want to create a README file, I will just click the Create New File icon to create the new file.
  •  Open Terminal Here (attribution in source)  I found this on the internet. This opens a terminal with the working directory the same as the current Finder directory.
  •  Open with Text Editor  This opens the currently selected file with the text editor. The script can be modified to use the text editor that you prefer (e.g., emacs). When uploading the TextEdit icon I noticed an easter egg which can be seen by looking at the full-size icon.
  •  Copy Path to Clipboard  This copies the path of the currently selected file (or the current directory if no file is selected) to the clipboard.
  •  Create Shortcut on Desktop  This creates a shortcut on the Desktop to the currently selected file (or the current directory if no file is selected). I like to have shortcuts on my Desktop to projects that I am working on. I find this easier than creating an alias in the current directory and then renaming it to remove the alias suffix, and then dragging it to the Desktop. However, my script creates a symbolic link, not an OS X alias, but that works fine for me.
  •  Open Current Directory in muCommander  This opens the current directory in muCommander. I find this useful when I need to browse a folder with hidden files. Although there is a way to toggle hidden files in Finder, I prefer using muCommander. muCommander is required for this script to work correctly. Also, the script expects muCommander to be working in a two-pane mode (which may be the only mode possible) and opens the current folder in the right pane.

Installation

To install these scripts, unzip the following file to any directory (e.g., ~/Launchers, where ~ is your home directory), and drag the icons to your Finder toolbar.

FinderScripts.zip

Disclaimer: These work fine for me, but use them at your own risk.

3 replies on “OS X Finder Shortcuts”

Hi Daniel,
These scripts are really helpful. But if muCommander has already been opened, the script doesn’t work as expected. Try on different folders in Finder and you will find this. And the opened folder is in the right panel instead of the left one.
Thanks,
Bill David

Leave a Reply to Bill David Cancel reply

Your email address will not be published. Required fields are marked *