Skip to main content

Check in my ‘reveal’ script for opening the macOS Finder

ID
6fb882d
date
2024-02-17 08:02:49+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
9ed2ac2
message
Check in my 'reveal' script for opening the macOS Finder
changed files
2 files, 21 additions, 1 deletion

Changed files

fs/README.md (4359) → fs/README.md (4727)

diff --git a/fs/README.md b/fs/README.md
index 68644b0..a25e139 100644
--- a/fs/README.md
+++ b/fs/README.md
@@ -55,6 +55,10 @@ scripts = [
         "description": "prints the path to the newest file in my Downloads folder"
     },
     {
+        "usage": "reveal PATH",
+        "description": "reveal the file/folder in the macOS Finder; alias for <code>open -R</code>"
+    },
+    {
         "name": "sizes",
         "description": """
         gets the total size of all the files/folders under the working directory, and prints them in a table
@@ -141,6 +145,15 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
   </dd>
 
   <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/fs/reveal">
+      <code>reveal PATH</code>
+    </a>
+  </dt>
+  <dd>
+    reveal the file/folder in the macOS Finder; alias for <code>open -R</code>
+  </dd>
+
+  <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/fs/sizes">
       <code>sizes</code>
     </a>
@@ -156,4 +169,4 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
       7.58M ~/repos/scripts</code></pre></p>
   </dd>
 </dl>
-<!-- [[[end]]] (checksum: 76e15300c60dae8de5db3c785debc5cf) -->
+<!-- [[[end]]] (checksum: 632a7aa9e05edd9243371bf85c14b266) -->

fs/reveal (0) → fs/reveal (105)

diff --git a/fs/reveal b/fs/reveal
new file mode 100755
index 0000000..51f3bb3
--- /dev/null
+++ b/fs/reveal
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+# Reveal the file/folder in the Finder.
+
+set -o errexit
+set -o nounset
+
+open -R "$@"