{"id":1075,"date":"2011-10-28T16:38:33","date_gmt":"2011-10-28T23:38:33","guid":{"rendered":"http:\/\/www.dannyadam.com\/blog\/?p=1075"},"modified":"2018-09-28T11:17:57","modified_gmt":"2018-09-28T16:17:57","slug":"os-x-finder-shortcuts","status":"publish","type":"post","link":"https:\/\/www.dannyadam.com\/blog\/2011\/10\/os-x-finder-shortcuts\/","title":{"rendered":"OS X Finder Shortcuts"},"content":{"rendered":"<p><strong>Update 9\/29\/2018:<\/strong>\u00a0The scripts no longer work as-is on macOS 10.14 Mojave. If you&#8217;ve already installed them, you will receive the error,\u00a0<code>Not authorized to send Apple events to Finder. (-1743)<\/code>. A workaround is to open each app in <code>Script Editor<\/code>, 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&#8217;t already installed the apps, you will receive a &#8220;<em>Program<\/em> is damaged&#8230;&#8221; message when trying to load the application in <code>Script Editor<\/code>. The workaround steps from the 1\/27\/2014 update below are no longer applicable, since the <em>Anywhere<\/em>\u00a0option is no longer available in the security settings. This can be altered by running\u00a0<code>sudo spctl --master-disable<\/code> to temporarily disable Gatekeeper before initially launching or editing the apps, and then <code>sudo spctl --master-enable<\/code> afterwards to turn Gatekeeper back on. However, even after doing this you&#8217;ll still have to use the workaround for the\u00a0<code>-1743<\/code>\u00a0error 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 <code>Script Editor<\/code>).<\/p>\n<p><strong>Update 1\/27\/2014:<\/strong>\u00a0Depending 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 &#8220;<em>Program<\/em>\u00a0is damaged and can\u2019t be opened. You should move it to the Trash.&#8221; To prevent this from happening, open Gatekeeper settings located in\u00a0<em>System Preferences &gt; Security &amp; Privacy<\/em>. Make a note of the current setting for\u00a0<em>Allow apps downloaded from:<\/em>, and then change it to\u00a0<em>Anywhere<\/em>\u00a0and confirm by pressing\u00a0<em>Allow From Anywhere<\/em>. 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.<\/p>\n<p><strong>Update 3\/4\/2012:<\/strong>\u00a0The <a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/FinderScripts.zip\">zip file<\/a> now includes the updated version of the muCommander launcher (see comments).<\/p>\n<p>I have <a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/FinderScripts.zip\">uploaded<\/a> a bunch of AppleScript scripts that I have found useful in OS X&#8217;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.<\/p>\n<p>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&#8217;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.<\/p>\n<p>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&#8217;t find. The image below shows the shortcuts to these scripts in my Finder toolbar.<\/p>\n<p><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/screenshot1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1106\" title=\"Screenshot\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/screenshot1.png\" alt=\"\" width=\"884\" height=\"542\" srcset=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/screenshot1.png 884w, https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/screenshot1-300x183.png 300w\" sizes=\"auto, (max-width: 884px) 100vw, 884px\" \/><\/a><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/screenshot.png\"><br \/>\n<!--more--><\/a>The list below describes each script, in the order that they appear in the Finder screenshot above. Click the titles for the source code.<\/p>\n<ul>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/new-empty-file-here.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25554\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/new-empty-file-here.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/New-Empty-File-Here.applescript\">Create New File<\/a>\u00a0<\/strong>(attribution in source)\u00a0 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&#8217;m working on a project and want to create a README file, I will just click the <em>Create New File<\/em>\u00a0icon to create the new file.<\/li>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-terminal-here.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25559\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-terminal-here.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/Open-Terminal-Here.applescript\">Open Terminal Here<\/a><\/strong>\u00a0(attribution in source)\u00a0 I found this on the internet.\u00a0This opens a terminal with the working directory the same as the current Finder directory.<\/li>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-with-text-editor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25560\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-with-text-editor.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/Open-with-Text-Editor.applescript\">Open with Text Editor<\/a><\/strong>\u00a0 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 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Easter_egg_(media)\">easter egg<\/a> which can be seen by looking at the <a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-with-text-editor.png\">full-size icon<\/a>.<\/li>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/copy-path-to-clipboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25568\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/copy-path-to-clipboard.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/Copy-Path.applescript\">Copy Path to Clipboard<\/a><\/strong>\u00a0 This copies the path of the currently selected file (or the current directory if no file is selected) to the clipboard.<\/li>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/shortcut-on-desktop.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25563\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/shortcut-on-desktop.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/Shortcut-on-Desktop.applescript\">Create Shortcut on Desktop<\/a><\/strong>\u00a0 This creates a shortcut on the Desktop to the currently selected file\u00a0(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.<\/li>\n<li><strong><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-with-mucommander.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-25564\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/open-with-mucommander.png\" alt=\"\" width=\"64\" height=\"64\" \/><\/a>\u00a0<a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/Open-with-muCommander.applescript\">Open Current Directory in muCommander<\/a><\/strong>\u00a0 This opens the current directory in <a href=\"http:\/\/www.mucommander.com\/\">muCommander<\/a>. 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.<\/li>\n<\/ul>\n<p><strong>Installation<\/strong><\/p>\n<p>To install these scripts, unzip the following file to any directory (e.g., <em>~\/Launchers<\/em>, where ~ is your home directory), and drag the icons to your Finder toolbar.<\/p>\n<p><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2011\/10\/FinderScripts.zip\">FinderScripts.zip<\/a><\/p>\n<p>Disclaimer: These work fine for me, but use them at your own risk.<span style=\"font-size: small;\"><span style=\"line-height: 24px;\"><br \/>\n<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update 9\/29\/2018:\u00a0The scripts no longer work as-is on macOS 10.14 Mojave. If you&#8217;ve already installed them, you will receive the error,\u00a0Not 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 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[24,23,22],"class_list":["post-1075","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-applescript","tag-finder","tag-os-x"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1sCC6-hl","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/1075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/comments?post=1075"}],"version-history":[{"count":64,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/1075\/revisions"}],"predecessor-version":[{"id":25599,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/1075\/revisions\/25599"}],"wp:attachment":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/media?parent=1075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/categories?post=1075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/tags?post=1075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}