Skip to content

Instantly share code, notes, and snippets.

@stephancasas
stephancasas / last-finder-location.jxa.js
Created May 23, 2023 11:19
AppleScript: Open last Finder location
#!/usr/bin/env osascript -l JavaScript
const App = Application.currentApplication();
App.includeStandardAdditions = true;
function run(_) {
const finderPrefs = $.NSMutableDictionary.dictionaryWithContentsOfFile(
`${$.NSHomeDirectory().js}/Library/Preferences/com.apple.finder.plist`,
);
@gruber
gruber / New Folder or Window.scpt
Last active September 21, 2023 22:37
Finder: Use Cmd-N to Create a New Folder or a New Finder Window
(*
This script is for anyone who still has the classic Mac OS era habit of using
Command-N to create a new folder in the Finder. It's intended for use with
Red Sweater Software's excellent FastScripts utility -- a replacement for the
system's build-in Scripts menu that allows for assigning keyboard shortcuts
to scripts, on a per-application basis.
FastScripts: https://red-sweater.com/fastscripts/
Install the script here: ~/Library/Scripts/Applications/Finder/
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber: