Skip to content

Instantly share code, notes, and snippets.

@benzado
benzado / Archive Messages.applescript
Created July 25, 2011 21:51
Archive Messages (AppleScript for Mac Mail)
(*
Moves selected messages into an archive folder. I use FastScripts to bind this to Shift-Cmd-A.
For Gmail accounts, moves messages into "[Gmail]/All Mail"; for all other accounts, looks for a mailbox named "Archive".
Tested with Mail 4.5 (Mac OS X 10.6 Snow Leopard).
*)
tell application "Mail"
tell front message viewer
@gruber
gruber / AppleNewsURLRedirect.pl
Last active March 5, 2024 16:33
Given an Apple News URL, prints the original URL for the story.
#!/usr/bin/perl
# Given an Apple News URL, prints the original URL for the story.
#
# Usage:
# % AppleNewsURLRedirect.pl 'https://apple.news/Ae78KIEmMOHCVXD4VA7ysKw'
# or
# % echo 'https://apple.news/Ae78KIEmMOHCVXD4VA7ysKw' | AppleNewsURLRedirect.pl
#
# Author: John Gruber <https://daringfireball.net/>