Last active
May 26, 2024 19:43
-
-
Save leoncowle/557eb3fbc0a3e85a8dc624782a9fbe0d to your computer and use it in GitHub Desktop.
AppleScript to add &udm=14 to Google Searches in Safari -- to get the simple (no AI, etc) view. I use FastScripts to bind this to Cmd-R (only for Safari).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple script to reload a Google Search result in Safari, adding the "&udm=14" querystring arg, | |
# which results in a simpler, non-AI (etc) view of results. | |
# Save this script in your /Users/<username>/Library/Scripts/Applications/Safari folder | |
# (create those subfolders if needed), and then use FastScripts to assign the ⌘R shortcut to it | |
# Putting it in that folder "/Users/<username>/Library/Scripts/Applications/Safari" will mean FastScripts will only | |
# bind ⌘R to it when Safari is the front-most application. Other applications will retain their native ⌘R behavior. | |
# Author: Leon Cowle | |
# License: Feel free to use/change it. But be kind in attribution. :-) | |
tell application "Safari" | |
set theURL to the URL of the current tab of the front window | |
if theURL starts with "https://www.google.com/search" then | |
# if it's a Google search, add &udm=14 if not already added | |
if "&udm=14" is not in theURL then | |
set theURL to theURL & "&udm=14" | |
end if | |
end if | |
# Regardless of whether it's a Google search or not, reload the tab | |
# because we're binding to ⌘R in FastScripts (only for Safari) | |
set URL of the current tab of the front window to theURL | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment