Skip to main content

Move furl into a script

ID
11cce71
date
2024-09-17 20:46:16+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
a92ef28
message
Move `furl` into a script
changed files
3 files, 20 additions, 5 deletions

Changed files

config.fish (7280) → config.fish (7001)

diff --git a/config.fish b/config.fish
index a190c0b..a4aa09f 100644
--- a/config.fish
+++ b/config.fish
@@ -142,10 +142,6 @@ end
 
 # Load macOS-specific utilities
 if [ (uname -s) = Darwin ]
-    # Provide a convenient alias for the front URL in both browsers
-    alias furl="osascript -e 'tell application \"Safari\" to get URL of document 1'"
-    alias gurl="osascript -e 'tell application \"Google Chrome\" to tell front window to get URL of tab (active tab index)'"
-
     # Get the URL of the frontmost GitHub page and clone it
     function gh-clone
         _ensure_ssh_key_loaded

macos/README.md (6378) → macos/README.md (6668)

diff --git a/macos/README.md b/macos/README.md
index bc415c9..c978a0b 100644
--- a/macos/README.md
+++ b/macos/README.md
@@ -37,6 +37,10 @@ scripts = [
         "description": "print the path to the frontmost selected item in Finder"
     },
     {
+        "name": "furl",
+        "description": "get the URL of the frontmost Safari window"
+    },
+    {
         "name": "find_processes_using_secure_input",
         "description": "lists any processes using Secure Input, which can block apps like TextExpander"
     },
@@ -129,6 +133,15 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
   </dd>
 
   <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/macos/furl">
+      <code>furl</code>
+    </a>
+  </dt>
+  <dd>
+    get the URL of the frontmost Safari window
+  </dd>
+
+  <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/macos/find_processes_using_secure_input">
       <code>find_processes_using_secure_input</code>
     </a>
@@ -212,4 +225,4 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
     </p>
   </dd>
 </dl>
-<!-- [[[end]]] (checksum: c1f5a62504ef1ef8f73a1f81751b9997) -->
+<!-- [[[end]]] (checksum: e560a98d56d0c36aa6d1e4d9318baf1e) -->

macos/furl (0) → macos/furl (131)

diff --git a/macos/furl b/macos/furl
new file mode 100755
index 0000000..76f4f25
--- /dev/null
+++ b/macos/furl
@@ -0,0 +1,6 @@
+#!/usr/bin/env osascript
+# Get the URL of the frontmost Safari window.
+
+tell application "Safari"
+  get URL of document 1
+end tell