Skip to content

Instantly share code, notes, and snippets.

@leoncowle
leoncowle / finderselect.scpt
Last active December 3, 2024 12:18
From Terminal, run AppleScript to select files in Finder
# Author: Leon Cowle <[email protected]>
# Version: 0.1 (9/21/2024)
# License: Free to use/copy/whatever :)
# Simple AppleScript script to call from Terminal. It opens a Finder window to the current working dir,
# and then selects all the files given as arguments to the AppleScript script.
# Suggestion: use an alias in your shell, e.g.:
# alias sel="osascript /path/to/this/finderselect.scpt"
# and then run it like this:
# $ sel image2015*.jpg
@leoncowle
leoncowle / make-google-suck-less.scpt
Last active May 26, 2024 19:43
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).
# 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"