Skip to content

Instantly share code, notes, and snippets.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
-- The folder to save the attachments in (must already exist)
set attachmentsFolder to ((path to home folder) & "Documents:Attachments") as string
-- Save in a sub-folder based on the name of the rule in Mail
@RosemaryOrchard
RosemaryOrchard / anchor_bookmarklet.js
Last active April 30, 2024 18:55
Reveal anchor links on websites. To add this to your bookmarks (bar), bookmark this page, copy the script below, edit the bookmark and change the address to the script.
javascript: (() => {
var anchorTest = 'bookmarklet-anchor-test';
if (document.getElementById(anchorTest)) {
alert("Anchors already present");
return;
}
function createAnchor(anchorId) {
var anchor = document.createElement('a');
anchor.href = '#' + anchorId;