Tags » macos
-
TIL: Where does AirDrop save files on macOS?
Look in
/private/tmp
. -
TIL: Get the dimensions of a video file with
mediainfo
-
TIL: Get video dimensions on macOS with built-in tools
If the video file is indexed by Spotlight, you can use
mdls
to get the width andheight
of a video file. -
TIL: Editing a filename in Finder will convert it to NFD
Even if the filename looks the same, it may be invisibly converted to a different sequence of bytes.
-
TIL: How can I work out what program is keeping a disk open?
Use
sudo lsof
and grep for the name of the disk you’re trying to eject. -
TIL: How to find all of Apple’s system icons
You need to look for files named
*.icns
inside any subdirectory ofCoreTypes.bundle
. -
Going between Finder and the Terminal
A few shell scripts I use to go between the Finder and the Terminal.
-
TIL: How to get the selected item in Finder using AppleScript
-
TIL: The
open
command can ask questionsIf you pass an argument that can’t be easily identified as a file or a URL,
open
will ask you what to do next. This may be a surprise if you were trying to use it in a script. -
TIL: Exclude files from Time Machine with
tmutil addexclusion
-
TIL: Run a script on macOS on a schedule using a LaunchAgent
-
TIL: Manage MP3 metadata from iTunes with eyed3
-
Snippets to manage albums in Photos.app
AppleScript only allows us to add photos to an album; dipping into Swift and PhotoKit lets us both add and remove photos.
-
Changing the macOS accent colour without System Preferences
Updating the accent colour everywhere, with immediate effect, using a script written in Swift.
-
Closing lots of Safari tabs with JXA
To help me keep my tab count down, I wrote a JXA script to close tabs that can easily be recreated.
-
A tale of two path separators
macOS allows both the slash and colon as path separators, and this caused me no small amount of confusion.
-
Programatically finding the original filename of a photo in the macOS Photos Library
If you’re looking at a UUID’d file in the PhotosLibrary package, how do you find its original filename?
-
How to ignore lots of folders in Spotlight
A script that allows me to ignore folders like “target” and “node_modules”, so they don’t appear in search results.
-
Using AppleScript to detect if a Safari window uses Private Browsing
-
Finding the app/process that’s using Secure Input
A Python script that shows me the name of processes that have Secure Input enabled.
-
An AppleScript to toggle Voice Control
Making it slightly easier for me to enable and disable Voice Control quickly.
-
Using qlmanage to create thumbnails on macOS
How you can invoke Quick Look on the command-line to generate high-quality thumbnails.
-
Getting a Markdown link to a window in Safari
-
Changing the accent colour of ICNS icons
Playing with macOS ICNS image files to create colourful new icons.
-
Using AppleScript to open a URL in Private Browsing in Safari
-
Finding the latest screenshot in macOS Mojave
-
Clearing disk space on OS X
A few tools and utilities I’ve been using to help clear disk space on my Mac.
-
Pretty printing JSON and XML in the shell
-
Export a list of URLs from Safari Reading List
A Python script for getting a list of URLs from Safari Reading List.