Posts

Copy to clipboard button for Google Drive files

A better file viewer than the one Google provides, that's more suitable for displaying code and text files, with a Copy to clipboard button as well — great when using mobile devices that only offer Select All functionality for editable text. Go to Apps Script in your Google account Click New project in the upper left corner In the code editor, replace everything with the following: function doGet(e) { const id = "FILE_ID"; const file = DriveApp.getFileById(id); const contents = file.getBlob().setContentType("text/plain").getDataAsString(); const html = `<!DOCTYPE html> <html> <head> <base target="_top"> <style> :root { color-scheme: light dark; } pre { overflow-wrap: break-word; white-space: pre-wrap; } </style> </head> <body> <button id="copy">Copy to clipboar...

Always, 100% of the time, open tabs to the right of the current tab in Safari for macOS

Here's how you can fix the chronic pain in the neck New Tab behaviour in Safari for macOS, where there's no way at all for users to decide the position their new tabs should open at. For new blank tabs Download Keyboard Cowboy [open source] Install and launch it Once opened, in the leftmost panel… Under Configuration , leave it at Default Configuration Under Groups , click the barely visible Add Group button In the window that opens, set the name to Safari , then in the Application drop-down menu, select Safari, and finally click Save Make sure the Safari group is selected In the middle panel… Under Workflows , click the barely visible Add Workflow button In the rightmost panel… Set the workflow name to e.g. New tab Under Add Trigger , click the Keyboard Shortcut button Use command-T as the keyboard shortcut Click the New Command button and then in the popup menu, select Scripting and then New AppleScript ...

Run Python code in Shortcuts app without relying on apps or APIs

Simple shortcut that let's you enter some Python code, then executes the code and displays the output. Makes use of the Pyodide JavaScript library. This means you need an internet connection the first time you run it, but since the library is cached (not sure for how long), it's possible to use offline too. Installing packages with micropip or loadPackage currently doesn't work due to some unidentified bug or limitation in Shortcuts app. Download the shortcut here .

Deep-links to almost every Safari setting on iOS

More than 50 prefs: URLs to most of the subpages, buttons, switches and sections in the Safari settings pages on iOS. A few of them only works on specific devices. The URLs were mostly found by examining iOS system files and the rest through guesswork or trial and error. Click the titles to display the URL Allow Safari to access → Siri (page) prefs:root=SAFARI&path=SIRI Allow Safari to access → Search (page) prefs:root=SAFARI&path=SEARCH Default Browser App (page) N/A Preferred Language → Language (page) prefs:root=SAFARI&path=PREFERRED_LANGUAGE Search → Search Engine (page) prefs:root=SAFARI&path=SEARCH_ENGINE_SETTING Search → Also Use in Private Browsing (switch) N/A Search → Search Engine Suggestions (switch) prefs:root=SAFARI#SEARCH_SUGGESTION_SETTING Search → Safari Suggestions (switch) prefs:root=SAFARI#SIRI_SUGGESTIONS Search → Quick Website Search (page) prefs:root=SAFARI&path=SITE_SPECIFIC...

URL to the current Wi-Fi network on iOS and macOS

These URLs take you to the page that opens when you press the 'i' button next to the current network in Settings → Wi-Fi on iOS, or the 'Details…' button next to the current network in System Settings → Wi-Fi on macOS, where you can configure various advanced settings or view details about the network. iOS: prefs:root=WIFI&path=NetworkDetails macOS: x-apple.systempreferences:com.apple.wifi-settings-extension?NetworkDetails

URL scheme for sending SMS or iMessage to multiple recipients on iOS

Can be used to send a new single or multi-person message (optionally with the message included 1) in the URL ), or to open a previous conversation with one or more recipients. Phone numbers have to either be without space characters or URL encoded, and can be with or without country prefix. Looks like some SenderID names 2) are supported too, possibly depends on if the ID can receive messages or not. To specify multiple recipients, separate the numbers (or names) with a comma, e.g. 1-800-692-7753,1–800–854–3680 . If you want to include a message, it needs to be URL encoded. sms://open?addresses= numbers or names separated by comma or with a message attached: sms://open?addresses=12345678&body=My %20URL%20encoded%20message 1. "SMS WatchKit multiple number delimiter"—stackoverflow.com 2. GSM SMS alphanumeric SenderID

Apple Wallpaper Downloader — download the stock wallpapers for every macOS release

Get 161 beautiful wallpapers with this shortcut for iOS and macOS, that downloads all the stock wallpapers included with the current and all previous versions of macOS, directly from Apple's website. The wallpapers are also perfectly suitable for iPhones, iPads etc. Because the original wallpaper files are losslessly compressed, it takes a few minutes to download and convert everything to lossy JPEG files. Download the shortcut here .

Multi-line, full URL location dialog instead of single-line bar for your web browser

Use this bookmarklet if you like to see the entire URL, instead of maybe only 5 or 10 characters of it, whenever you feel like editing or viewing the current webpage URL.

Extract all individual images from multi-image HEIC files in Shortcuts on iOS and macOS

A shortcut for iOS and macOS that can for example be used to extract all the individual images from Apple's multi-image wallpaper files. Can also be used to batch convert both single-image and multi-image HEIC files to JPEG. Seems like every HEIC-compatible app on the App Store is only able to extract the first image from multi-image HEIC files. Same with the Convert Image action in Shortcuts app. There's also a Get Frames from Image action, but that's only for animated GIF and photo burst files, according to the description. It actually accepts HEIC files as well, but unfortunately only the main image get's extracted here too. What about tricking the action to extract the others too by changing the file extension to gif , without the resulting images ending up as GIFs, despite the troubling extension name? That's exactly what this shortcut is doing.

URL scheme for viewing currently stored website data on iOS Safari

If you want to view or delete website data for specific sites in Safari for iOS, use the following URL to get directly to the page you finally arrive on after locating the Website Data button somewhere on the page you opened after locating the Advanced button somewhere on the page you opened after locating the Safari button somewhere on the page you opened after locating the Apps button somewhere on the Settings main page: prefs:root=SAFARI&path=ADVANCED/REMOVE_WEBSITE_DATA

Take a screenshot of the current macOS window with a single click or keyboard shortcut

A macOS shortcut that simply copies a screenshot of the current app's frontmost window to the clipboard — a lot quicker than pressing shift-command-4, then spacebar and then left-clicking the window when the pointer turns into a camera symbol (if you even managed to remember the super-secret procedure). To make the shortcut run from a keyboard shortcut, click the 'i' button at the top of the sidebar, then the 'Add Keyboard Shortcut' button, and then press your keyboard combination. You have to wait some time for the keyboard shortcut to be activated systemwide (less than a minute), but if you restart the app you want the screenshot from, it will work immediately. Download the shortcut here .

Web inspector and console bookmarklet that bypasses CSP

Great if you're a Safari user on iOS and don't want to connect your device to a Mac to have this functionality. Works on most CSP-restricted pages, except pages with maximum security policies like github.com and developer.mozilla.org . The bookmarklet contains the entire Eruda JavaScript library as a base64-encoded string in order to bypass the script-src-elem CSP restrictions. If you have concerns about the safety of the bookmarklet, you can always decode the base64 string and compare it to the original script (v3.4.1).

Run JavaScript actions in Shortcuts app without data: URLs, external apps or APIs

It's already possible to run JavaScript code natively in Shortcuts app through the data: URL method 1) , but this one is less complicated and easier to remember. 1. Inside a Text action, create an HTML document containing script code that writes its output to a visible element 2. Either convert the document with the Make Rich Text from HTML action or use the Set Name action and set the name to index.html (or another name with a html extension). 3. Convert the result from the previous step with the Make PDF action 2) (use default settings) 4. Instead of using the Get Text from Input action to extract the text, use the Combine Text [with newlines] action which also converts the input to plain text. This is because the length of the output could cause multiple PDF pages being produced, which end up becoming separate Shortcuts list items that you would have needed to combine either way. Example shortuct here . 1. "Using JavaScript in your shortcuts"—reddit.com 2. T...

Python dialog box bookmarklet for running code in current web browser tab

With this bookmarklet you can run Python code inside a dialog box on the web page you're currently viewing. Works on most pages, but not on pages with very strict content security policies.

Crop images to circle or heart in Shortcuts on iOS and macOS

A shortcut for iOS and macOS that converts an image to the shape of a circle, heart, square or app icon. The source image can be any aspect ratio — just make sure what you want to include is in the middle part of the image. Download the shortcut here .

Spoof user agent bookmarklet

Reloads the current web page with the user agent of your choice. Doesn't work on every site (DuckDuckGo, for example) and stops working as soon as you navigate away from the page. Some sites use other detection methods so they still see the real user agent. Tested to work on iOS browsers and macOS Safari.

URL scheme to open the keypad in Phone app on iOS

Could for example be used in a shortcut that copies a GSM code to the clipboard, opens the keypad URL and (since there doesn't seem to be any way to include the number/code in the URL) instructs you to paste and then press the call button. Or if you for some other reason just want a quick way to open the keypad. mobilephone-keypad://

Extract iOS backups with stock macOS Terminal commands

The following extracts your iOS backup files as APFS clone files (which take zero storage space), gives the hashed filenames their real names and moves them into folders based on their associated domain , making everything easily browsable in Finder. 1. Navigate to the backup folder: cd ~/Library/Application\ Support/MobileSync/Backup/ 2. Look for a folder that contains a Manifest.db file and lots of 2-character subfolders and then run: cd FOLDER_NAME 3. Run the following command which extracts everything to ~/Desktop/ios_backup , except the files you can access from Files app — if you want to extract those as well, leave out ` | grep -v "File Provider Storage" ` before ` | sh ` at the end: sqlite3 Manifest.db '.mode list' '.once /dev/stdout' 'select "find . -name " || fileID || " | xargs -I{} ditto --clone {} ~/""Desktop/ios_backup/'${PWD##*/}'/" || domain || "/" || relativePath || ""...

URL for disabling Shortcuts notifications on iOS

Did you know there's a prefs: URL that takes you the notifications settings for Shortcuts app on iOS 1) , except that it only works some of the time? Fortunately there's a way to make it work every time. Since the URL goes to the Shortcuts notifications settings via Screen Time settings and these pages aren't static, you need to let the content finish loading before moving on to the next path segment. The solution is to open each segment separately with a 1 second pause between, like this: Open   prefs:root=SCREEN_TIME Wait 1 second Open   prefs:root=SCREEN_TIME&path=SCREEN_TIME_SUMMARY Wait 1 second Open   prefs:root=SCREEN_TIME&path=SCREEN_TIME_SUMMARY/com.apple.shortcuts Only works if there were any notifications in the last 7 days, though, but you can just run a shortcut that shows a notification and the URLs will work after a few seconds. Note 1: for this to work to begin with, you need to have App & Website Activity turned on in Settings ...