Clipboard Tool

load, preview, modify, convert, clear, save, restore, sync, and share the iOS clipboard


Description


A video overview of Clipboard Tool is available here.


Overview

Clipboard Tool is a full-featured shortcut that can be used to load, preview, modify, convert, clear, save, restore, sync, and share the iOS Clipboard.

In addition, Clipboard Tool accepts input that can be used to optionally update the Clipboard. For example, the URL (or content) from a web page could passed and saved by accessing Clipboard Tool from the iOS Share Sheet in Safari.

Clipboard (and Shortcut Input) values can be saved for later use.

Values are saved to iCloud, thus they can be shared with any device that shares the same iCloud account. Saved values can be restored to replace, prepend, or append the Clipboard.

Clipboard Tool operation can be customized using two Configuration Parameters.


Summary of Features

  • The following Types are explicitly supported: Text 🅣, Rich text 🅡, Image 🅘, Media (i.e., video, audio) 🅜, PDF 🅟, Dictionary (i.e., JSON) 🅓, File 🅕, Archive (i.e., zip file) 🅐. Any other types are classified as Other 🅞.
  • Clipboard Type and Length (for Text and Rich text) are indicated.
  • The Clipboard can be previewed and shared.
  • Rich text can be converted to plain text.
  • Dictionaries (i.e., JSON file content) can be converted to pretty text.
  • Shortcut Input can be optionally used to update the Clipboard. For example, photos, screenshots, and videos can be shared from the Photo app; files (of many types) can be shared from the Files app; and URLs, Page Titles, and Page Content can be shared from iOS browsers. The following browsers have been tested: Safari, DuckDuckGo, Chrome, Browser and Documents Manager, Opera Touch, Private Browser Deluxe, 1Password, Onion, Reedle Documents (only passes URL, i.e., no Page Title under some circumstances), Firefox, Firefox Focus, Brave, Edge, Dolphin (iOS 14 crashes), Ghostery, Yandex.
  • Clipboard/Shortcut Input values can be saved and later restored. Values are saved to iCloud, thus they can be shared with any device that shares the same iCloud account.
  • Shortcut Input and Clipboard values can be previewed/saved independently, or the Clipboard can be automatically updated (depending on the Automatically Copy Shortcut Input to Clipboard configuration parameter).
  • Restored values can replace, prepend, append the current Clipboard. If the entries are Text, the text is prepended or appended; other types become multiple entries in the iOS Clipboard (i.e., like an array, but not limited to the same Type). For example, the Clipboard could be modified to include the following: Image, PDF, and a text string.
  • Saved values are shared between iOS devices, thus a Clipboard saved on one device can be restored on another.
  • Titles can be optionally added to the saved entries. Titles are automatically suggested for some circumstances. For example, if the Clipboard includes 25 lines of text, Clipboard Tool will suggest the following title: 25🄻.
  • Text clipboards can be modified; Image clipboards can be marked up.
  • The Clipboard can be cleared with or without confirmation (depending on the Confirm Clipboard Clear configuration parameter).
  • Saved clipboards can be multiple items (e.g., three images), including entries of different types (e.g., Image, Text).
  • Clipboard Tool is compatible with iOS 13 and iOS 14.

Shortcut Testing

Clipboard Tool, Version 2.1, has been tested with the following:

  • iOS 13.7, 14.0.1 and 14.2 Developer Beta 3
  • iPhone 8 Plus
  • iPad Pro 10.5"

Shortcut Development and Acknowledgments

  • Clipboard Tool is available exclusively at RoutineHub.co. Versions obtained elsewhere might be out-of-date.

  • This shortcut includes a complex Dictionary action that includes 33 context sensitive variations of the main menu. Configuring a large Dictionary like this manually would be very tedious and error-prone, thus it was built using a very creative and useful shortcut named Dictionary Action Builder, by @gluebyte.

  • There were a few additional JSON tools that were used during the development of this shortcut: a) The Prettify action included in the iOS app, Jayson, by Simon B. Støvring; b) The Pretty Print Dictionaries action included in the iOS app, Toolbox Pro for Shortcuts, by Alex Hay; c) [JSON FORMATTER & VALIDATOR] (https://jsonformatter.curiousconcept.com), by CURIOUS CONCEPT; and d) JSONLint - The JSON VALIDATOR, by CircleCell.

  • As mentioned above, Clipboard Tool can accept values by launching it via the Share Sheet. Many different file types have been tested from a variety of iOS apps. During testing using the Files app, two iOS bugs (?) were discovered: 1) If a JSON file is long-tapped and Share is selected, Clipboard Tool is selected from the Share Sheet, nothing is passed to the shortcut. This appears to be a universal bug with JSON files, not necessary limited to the Files app. 2) If the JSON file is copied (rather than shared) and any shortcut like Clipboard Tool is started, the iOS Clipboard is sometimes not populated with the contents of the JSON file. This can normally be addressed by repeating the copy process from the Files app.

  • As mentioned above, Clipboard Tool can convert Dictionaries (i.e., JSON file content) to pretty text. I found the necessary actions in a shortcut created by reddit user u/gluebyte. For more information, please refer to Dictionary/JSON Pretty Print.

  • One weakness of iOS 14 shortcuts is that lists can be scroll sluggishly as the number of entries grow large. To circumvent this shortcoming, when the saved items exceeds a defined threshold, this shortcut combines actions that provide a means to list a subset of saved items. In addition when it exceeds another defined threshold, it includes pagination logic that was derived from PaginateList in .libUILibrary by @entee. Although likely unnecessary, these list thresholds can be adjusted using the Choose from List (iOS 14) dictionary embedded in the shortcut main dictionary.

  • The framed screenshots were created using the shortcut Apple Frames (iOS) from the MacStories Shortcuts Archive.

  • Clipboard Tool checks for updates of itself every 7 days using Embed-a-Update (Version: 1.1.2, Updated: 10/13/19). On demand update checking can be performed by running Swing Updater.


Latest Release Notes

2.1 - Oct. 19, 2020, 2:40 a.m.

- Optimized to reduce shortcut execution time.
- Improved embedded comments.


Version history