├── .gitignore ├── AutoUnsubscribe.md ├── LICENSE ├── MenuGenerator.md ├── README.md ├── dup.md ├── img ├── MediaKitCred.PNG ├── Mosaic_banner.png ├── Mosaic_color space.png ├── Mosaic_examples.png ├── Mosaic_grid size.png ├── Mosaic_long and tall images.png ├── Mosaic_progress.png ├── Mosaic_tile matching.png ├── Mosaic_tile subdivision.png ├── Mosaic_tile useage.png ├── ReminderPDF.png ├── TSP_features.png ├── TSP_permissions.png ├── TSP_routing_map.png ├── TSP_share sheet.png ├── ThinkBuddy chat viewer.png ├── auto unsub automation1.png ├── auto unsub automation2.png ├── auto unsub logged.png ├── auto unsub method1.png ├── auto unsub method2.png ├── auto unsub test.png ├── dup_1banner.png ├── dup_2selection.png ├── dup_3search.png ├── dup_4clean.png ├── dup_5config.png ├── dup_collage.png ├── gemini_dropin.png ├── gemini_file_types.png ├── gemini_image.png ├── gemini_pdf.png ├── gemini_tests.png ├── gemini_text.png ├── gemini_viewer.png ├── gemini_viewer_iOS.png ├── gemini_viewer_macOS.png ├── made-with-menu-generator-badge.png ├── menu-generator-advanced-menu.png ├── menu-generator-banner.png ├── menu-generator-example.png ├── menu-generator-font-awesome-site.png ├── menu-generator-hero-image.png ├── menu-generator-permissions.png ├── menu-generator-quick-menu-example.png ├── photo_collage_video_thumb.png ├── powered by gemini via api.PNG ├── powered_by_pro_ai.png ├── social_banner.png └── view-continue-gemini-convo.png └── mosaic_readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .qodo 3 | -------------------------------------------------------------------------------- /AutoUnsubscribe.md: -------------------------------------------------------------------------------- 1 | # Auto Unsubscribe 2 | 3 | *Google Gemini version using Gemini via API* 4 | 5 | Auto Unsubscribe is a shortcut for automatically sending opt-out responses (e.g. "STOP") to spam text messages. 6 | I made it because I get far too many political texts, but needed a tool that wouldn't auto-unsubscribe from *everything*, just the spam I don't want. 7 | 8 | So far it's worked pretty good with 100% accuracy for the spam texts I receive. \*knocks wood 9 | 10 | ## How it works 11 | 12 | Incoming messages are screened for spam and categorized, and the chosen categories are automatically replied to. 13 | 14 | 1. You set it up as an automation, triggered by messages with the word "stop" in them, because the spam I get often contains some variation of "stop to quit" at the end. 15 | 1. You also define a list of types of spam that you want to use as categories, 16 | 2. and the spam types that should be auto-responded to. 17 | 18 | | ![Basic setup](https://github.com/twilsonco/SiriShortcuts/blob/main/img/auto%20unsub%20method1.png?raw=true) | ![Check methods](https://github.com/twilsonco/SiriShortcuts/blob/main/img/auto%20unsub%20method2.png?raw=true) | 19 | | ----- | ----- | 20 | | Define basic opt-out phrase list, detection/capture [regex](https://regex101.com) string, define spam types. | More opt-out phrase checking and Google Gemini via API\* spam classification. | 21 | 22 | 1. When a message triggers the automation, it's checked a bit more rigorously for a matching opt-out phrase at the end of the message. 23 | 2. If a match is found, then Google Gemini is used as a classifier to determine the type of unsubscribability. 24 | 3. If the spam type is in the list of defined auto-respond types, then the opt out phrase is automatically sent in response. 25 | 26 | \* *Google via API could be swapped out with any other similar service. You could replace the `Dictionary` and `Run Gemini via API` actions with the `Ask ChatGPT` action from the ChatGPT app or use some other API* 27 | 28 | ## Installation 29 | 30 | ### 1. Set up automation 31 | 32 | 1. In the Shortcuts app on iOS/iPadOS, go to the Automations tab and tap the "+" button to create a new automation. 33 | 2. Select a "Messages" automation type, and then set the "Message Contains" option to be triggered by the word "stop". 34 | 3. Tap "Next". 35 | 36 | ![Install 1](https://github.com/twilsonco/SiriShortcuts/blob/main/img/auto%20unsub%20automation1.png?raw=true) 37 | 4. Now we'll select the automation action. Tap "New Blank Automation" 38 | 5. In the new shortcut that opens, add a `Dictionary` action and add "from" and "body" keys to the dictionary, both text items. 39 | 1. In the text field of each, tap and hold and select "Shortcut Input". 40 | 2. Tap on the "Shortcut Input" for the "from" key and set it to "Sender". 41 | 3. Tap on the "Shortcut Input" for the "body" key and set it to "Content". 42 | 6. Add a `Run Shortcut` action and point it to `Auto Unsubscribe`. 43 | 44 | ![Install 2](https://github.com/twilsonco/SiriShortcuts/blob/main/img/auto%20unsub%20automation2.png?raw=true) 45 | 46 | ### 2. Run Auto Unsubscribe in test mode 47 | 48 | Run Auto Unsubscribe manually to allow it to acquire necessary permissions. It will run using some predefined test data, and generate a log file in your iCloud Drive/Shortcuts folder. This log will record everything Auto Unsubscribe does. 49 | 50 | ![Log](https://github.com/twilsonco/SiriShortcuts/blob/main/img/auto%20unsub%20logged.png?raw=true) 51 | 52 | ## Notes 53 | 54 | * When run manually, the shortcut checks for updates and dependencies. 55 | * I thought about having this do email too, but for email it's not as easy as replying with an opt-out phrase (you can often reply with subject "UNSUBSCRIBE" but it's not very dependable, and you often have a link to follow), so I probably won't try. At the very least I think it would take additional permissions each time it ran. 56 | * It would be cool to have Google Gemini determine the correct opt-out phrase to use, but I worry about it messing up. 57 | * Please let me know how this works for you, and feel free to offer suggestions and complaints. 58 | 59 | | [![MediaKit](https://github.com/twilsonco/SiriShortcuts/blob/main/img/MediaKitCred.PNG?raw=true)](https://routinehub.co/shortcut/1911/) | [![Gemini via API](https://github.com/twilsonco/SiriShortcuts/blob/main/img/powered%20by%20gemini%20via%20api.PNG?raw=true)](https://routinehub.co/shortcut/17624/) | 60 | | ----- | ----- | 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Tim Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MenuGenerator.md: -------------------------------------------------------------------------------- 1 | ![Menu Generator Banner](https://raw.githubusercontent.com/twilsonco/SiriShortcuts/main/img/menu-generator-banner.png) 2 | 3 | ![Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Froutinehub.co%2Fapi%2Fv1%2Fshortcuts%2F18397%2Fversions%2Flatest&query=%24.Version&label=Version&labelColor=green&color=%23320932.png) [![Download on RoutineHub](https://img.shields.io/badge/Download_On-RoutineHub-%23ee3535)](https://routinehub.co/shortcut/18397/) 4 | 5 | Easily create menus for your Shortcuts **without any external apps**. 6 | 7 | Menu Generator can be embedded or run from the `Run Shortcut` action to create stunning, feature-rich menus. 8 | 9 | Feed it the command and menu data in a dictionary or text field, then it does the rest! 10 | 11 | *** 12 | 13 | ![Menu Generator Screenshots](https://github.com/twilsonco/SiriShortcuts/blob/main/img/menu-generator-hero-image.png?raw=true) 14 | 15 | ## Menu Generator Features 16 | 17 | **Flexible Icons:** With four different types of icon choices, it should be easy to find an icon for any menu option. Supported Icons: 18 | 19 | - Base64 icons (e.g., created from photos, or bring your own). 20 | - Font Awesome icons. 21 | - Emoji icons. 22 | - Photo icons (resized to 123x123 pixels and converted to base64). 23 | 24 | **Quick menus:** Create simple menus using a single text field similar to [Toolbox Pro's](https://apps.apple.com/us/app/toolbox-pro-for-shortcuts/id1476205977) Quick Menu feature. 25 | 26 | **Advanced menus:** Define menu items individually using dictionaries for optimized menus with maximal customization, again like [Toolbox Pro](https://apps.apple.com/us/app/toolbox-pro-for-shortcuts/id1476205977). 27 | 28 | **Unlimited Custom Fields:** Include "hidden" fields to store data with menu items that is not shown in the created menu, and that can be accessed after a menu option is tapped. You can define as many custom fields as needed. 29 | 30 | **Create menus or base64 for later:** Use to create full menus or convert images to base64 for other uses. 31 | 32 | **Embeddable:** Put this shortcut inside any shortcut to add picture/icon menus without complicating installation/distribution. 33 | 34 | **Icon caching:** Icons are cached to a file in your iCloud to increase performance. 35 | 36 | ## Limited Permission Prompts 37 | 38 | ![Menu Generator Permissions Screenshots](https://raw.githubusercontent.com/twilsonco/SiriShortcuts/main/img/menu-generator-permissions.png) 39 | 40 | Because no external apps (e.g. Toolbox Pro or Actions) are used, permission prompts are limited to just: 41 | 42 | - Running another Shortcut (unless embedded within a shortcut). 43 | - Loading web content (for Font Awesome icons). 44 | 45 | ## How To Use Menu Generator 46 | 47 | Every time you run Menu Generator, you'll use an input dictionary that contains the command to run along with any necessary/optional information that goes along with the command. The commands and their inputs are listed below: 48 | 49 | ----- 50 | 51 | ### Commands 52 | 53 | - `menu` 54 | - Create vCard menu as single text string 55 | - Inputs: `"menu"`: list of valid menu item dictionaries 56 | - Output: vCard menu as a text string 57 | - `menu items` 58 | - Create list of vCard menu text strings 59 | - Inputs: `"menu"`: list of valid menu item dictionaries (described below) 60 | - Output: list of vCard items as text strings 61 | - `get menu item details` 62 | - Get a chosen menu item's dictionary using its `title` and `sub` (corresponding to `Name` and `Company` inside a `Contact` object), in order to easily access its properties. 63 | - Inputs: 64 | - `"title"` and `"sub"`: title and subtitle of menu item to get details for. 65 | - `"menu items"`: list of menu item dictionaries used to make the menu in the first place, and that will be searched to find the specified title and subtitle 66 | - Output: the found menu item matching the specified title and subtitle 67 | - `quick menu` 68 | - Create vCard menu as single text string using quick menu string 69 | - Inputs: `"menu"`: text string describing the quick menu 70 | - Output: vCard menu as a text string 71 | - `quick menu items` 72 | - Create list of vCard menu item text strings from quick menu string 73 | - Inputs: `"menu"`: text string describing the quick menu 74 | - Output: list of vCard items as text strings 75 | - `base64 overlay` 76 | - Prepare icon base64 by overlaying transparent PNG image on the specified background color 77 | - Inputs: 78 | - `"icon"`: base64 string of a png image with some transparency 79 | - `"background"`: hex string or valid HTML color name 80 | - `"size"`: text or number, relative size of image in resulting icon (0 to 1 as ratio of resulting image) 81 | - Output: base64 text string of overlaid image 82 | - `emoji icon` 83 | - Prepare icon base64 from emoji 84 | - Inputs: 85 | - `“icon”`: text, the emoji to create image from 86 | - `“size”`: optional: number, the size of the resulting image, between 0.0 and 1.0. Defaults to global shortcut default in config dictionary. 87 | - `“background”`: optional: hex color or HTML color name of background. Defaults to transparent on macOS and dark/light based on device dark mode setting on iOS. 88 | - Output: base64 text string of emoji icon 89 | - `font awesome icon` 90 | - Prepare icon base64 from specified Font Awesome icon name 91 | - HTML colors: https://www.w3schools.com/tags/ref_colornames.asp 92 | - Inputs: 93 | - `“icon”`: font awesome icon type and name, e.g. “fa-solid fa-font-awesome” 94 | - `“size”`: size of icon, from 0.0 to 1.0 95 | - `“color”`: hex color or HTML color name of icon, e.g. #1E3050 96 | - `“background”`: hex color or HTML color name of icon, e.g. #fff 97 | - Outputs: base64 text string of emoji icon 98 | 99 | ----- 100 | 101 | ![Menu Generator Menu Examples Screenshots](https://github.com/twilsonco/SiriShortcuts/blob/main/img/menu-generator-example.png?raw=true) 102 | 103 | ### Creating Advanced Menus 104 | 105 | You can use a list of menu item dictionaries to make menus, providing the most functionality and better performance than the text-based quick menus. 106 | 107 | #### Creating The List of Menu Item Dictionaries 108 | 109 | To make an advanced menu, you need to construct a list of dictionaries. Each dictionary can be created using the `Dictionary` action with the following text keys (see also the above images): 110 | 111 | 1. `title` - This will be the larger, bold text title for each menu option. 112 | 2. `sub` - This will be the smaller text below the title. 113 | 3. `icon` - Here is where you will specify either the base64 icon, emoji, or Font Awesome class name for the icon you want to use. 114 | 4. *[optional]* You can add additional fields that contain whatever information you want. These will not be printed in the created menu, and can be fetched later in order to drive more advanced behavior based on user selection. Here we use `field1` and `field2` as examples. 115 | 116 | ![Menu Generator - Menu Command Image](https://github.com/twilsonco/SiriShortcuts/blob/main/img/menu-generator-advanced-menu.png?raw=true) 117 | 118 | ##### The class name of a Font Awesome icon can be found on their website as in the image below. 119 | 120 | ![Menu Generator - Font Awesome icon class name](https://github.com/twilsonco/SiriShortcuts/blob/main/img/menu-generator-font-awesome-site.png?raw=true) 121 | 122 | #### Using The `menu` Command To Generate The Menu 123 | 124 | Once you've prepared your list of menu item dictionaries, we prepare an input dictionary for Menu Generator: 125 | 126 | 1. Make a new dictionary with a text key named `command` with the value `menu`. 127 | 2. Next, add a `Set Dictionary` action and set the value of the `menu` key to your list of menu item dictionaries (here we've named the list variable `Menu item list`). 128 | 3. Below that, use the `Run Shortcut` action to run Menu Generator, and pass the dictionary from step 1 as input. 129 | 130 | #### Tell Shortcuts That The Output Is A vCard File 131 | 132 | The output of the `Run Shortcut` action will be a single text object that contains the created menu. 133 | 134 | 1. Use a `Set Name` action to set the name of the `Shortcut Result` to `menu.vcf`. 135 | 2. Finally, add a `Choose From List` action to choose from `Renamed Item`, and make sure the type of `Renamed Item` is set to `contact`. 136 | 137 | #### Retrieving Data From The Chosen Menu Option 138 | 139 | If you added any non-printed "extra" fields to your menu (we added `field1` and `field2` in our example), you can use the `get menu item details` command to fetch that data from the user-selected item. 140 | 141 | 1. Create another dictionary with the following text keys: 142 | - `command` - With the value `get menu item details`. 143 | - `title` - With the value `Name` pulled from a magic variable of the `Renamed Item`. 144 | - `sub` - With the value `Company` also pulled from a magic variable of the `Renamed Item`. 145 | 2. Pass this dictionary as input to a `Run Shortcut` action pointing to Menu Generator. 146 | 3. The `Shortcut Result` will be the menu item dictionary corresponding to the user-selected menu item. 147 | 4. Using the returned dictionary, you can then access any of the extra fields you defined earlier. 148 | 149 | ### Create A Menu With The Quick Menu Tool 150 | 151 | ![Menu Generator Quick Menu](https://github.com/twilsonco/SiriShortcuts/blob/main/img/menu-generator-quick-menu-example.png?raw=true) 152 | 153 | If you need a quick and simple method of making menus, then you can just throw everything into a `Text` action. 154 | 155 | #### Using A Text Field To Make A Menu 156 | 157 | 1. Define your icon with base64, Font Awesome, or an emoji. 158 | 2. Enter the text for each menu item. 159 | - Use `title`, `sub`, and `icon`, followed by a colon like so: `title: Hello World!`. 160 | - Make sure there is a line separating each menu option like the screenshot above. 161 | 3. Add a `Dictionary` action under the `text` action. 162 | 4. In that `Dictionary`, add two `Text` keys with the following values: 163 | - `command` With the value `quick menu`. 164 | - `menu` With the value `Quick menu text` pulled from the magic variable of the `Text` action. 165 | 5. Now, place a `Run Shortcut` action below that and select Menu Generator. 166 | 6. Then, use a `Set Name` action to set the name of the Shortcut Result to `menu.vcf`. 167 | 7. Next, add a `Choose From List` action to choose from the `Renamed Item`, and make sure the type is set to `contact`. 168 | 169 | After that, you can then use `If` actions to perform tasks based on the option selected. 170 | 171 | - When using quick menus, you cannot define extra, non-printed fields. 172 | - The `title` and `sub` values of the selected menu item are accessed using the `Name` and `Company` values of the selected menu item (a Contact object). 173 | 174 | *** 175 | 176 | ## Example Shortcuts 177 | 178 | The below example shortcuts demonstrate all of Menu Generator's features. Some analogous shortcuts doing the same things but using Toolbox Pro's menu capabilities are also provided, in order to make clear how similar the functionality and use are. 179 | 180 | - [Menu Generator Example - Menu](https://www.icloud.com/shortcuts/5e61965f9c06486ea42940958a7f44f3) 181 | - Creates an advanced menu with Menu Generator using the different types of icons (base64, Font Awesome, and Emoji). 182 | - [Toolbox Pro Menu Generator](https://www.icloud.com/shortcuts/895d5aea0129459aa5204c312742206e) - (*Requires Toolbox Pro*) 183 | - Uses Toolbox Pro to create an advanced menu. 184 | - [Menu Generator Example - Menu Items](https://www.icloud.com/shortcuts/effd803e7aae4421b79c3026838c8f3c) 185 | - Creates an advanced menu with Menu Generator, then uses the cache to present another menu without the need to regenerate anything. 186 | - [Menu Generator Example - Quick Menu](https://www.icloud.com/shortcuts/6d01003ff5bd4e91b784bef436385b6b) 187 | - Creates a quick menu utilizing a `text` action. 188 | - [Toolbox Pro Quick Menu](https://www.icloud.com/shortcuts/3bdb5b49dfb44884afc5472b6386919f) 189 | - Uses Toolbox Pro's `Quick menu` action. 190 | - [Menu Generator Example - Photo Menu](https://www.icloud.com/shortcuts/3862685e4e5348c7be3fae3326a41960) 191 | - Pulls the last 10 photos from your Photo Library to create a menu with photos for icons. 192 | - [Menu Generator Example - Convert to base64](https://www.icloud.com/shortcuts/5222bcac2ad644c5b7c075fa788901b3) 193 | 194 | ## Embed Menu Generator inside your shortcut 195 | 196 | Use the [Join Shortcuts](https://routinehub.co/shortcut/10038/) shortcut by [gluebyte](https://routinehub.co/user/gluebyte) to embed Menu Generator inside your own shortcut. 197 | 198 | - Simplify installation and distribution of your shortcut by removing the need for the user to install Menu Generator as a separate shortcut 199 | - Simplify running of your shortcut by removing the permissions prompt to "run another shortcut" 200 | - *Join Shortcuts works best on macOS, where it can sign the resulting merged shortcut* 201 | - As an alternative, you could start your own shortcut from a duplicate of the Menu Generator shortcut 202 | - Make sure to collapse the If action in order to hide all the Menu Generator actions and simplify subsequent shortcut development 203 | - As alternatives, you could 204 | - Use the recently released [Action Editor](https://routinehub.co/shortcut/18280/), also by gluebyte, or, 205 | - Use the recently released [Copy Shortcut Actions +++](https://routinehub.co/shortcut/18369/) by [robric18](https://routinehub.co/user/robric18). 206 | - Start your own shortcut from a duplicate of the Menu Generator shortcut. Make sure to collapse the If action in order to hide all the Menu Generator actions and simplify subsequent shortcut development. 207 | 208 | **As an example, my [Gemini Chat Manager](https://routinehub.co/shortcut/17671/) shortcut has Menu Generator embedded inside it.** 209 | 210 | 1. Install Menu Generator (this Shortcut) and the [Join Shortcuts](https://routinehub.co/shortcut/10038/) Shortcut: 211 | - Join Shortcuts works by allowing you to insert one Shortcut inside another. 212 | - Each Comment action in the destination Shortcut serves as a placeholder for inserting a source Shortcut. 213 | 2. Create a Comment action near the top of your Shortcut. Inside, put something like "menu generator". 214 | 3. Run the Join Shortcuts Shortcut. 215 | 4. Select your Shortcut at the destination Shortcut. 216 | 5. Select the comment made in step 2 as the place to insert the source Shortcut. 217 | 6. Select the Menu Generator Shortcut as the source Shortcut. 218 | 7. Select "Finish Joining" and save the resulting Shortcut as a copy or by replacing your Shortcut with the joined version. 219 | 8. Change any "Run Shortcut" actions to point to your Shortcut (so that it runs itself) instead of Menu Generator, and now your Shortcut has built-in pretty menus! 220 | 221 | ## Credits 222 | 223 | - [jpasholk’s “vCard Menu Helper”](https://routinehub.co/shortcut/18220) (Inspiration for this shortcut, though other great vCard menu shortcuts also exist). 224 | - [DylanShortcuts’ “Emoji to Image”](https://routinehub.co/shortcut/14899) adapted to turn an emoji into an image. 225 | - [SACUL_6’s “Create Menu Using Font Awesome”](https://routinehub.co/shortcut/17750) adapted for Font Awesome icon fetching. 226 | - [gluebyte's Join Shortcuts]((https://routinehub.co/shortcut/10038/)) shortcut was used in the development of this shortcut. 227 | - Though unrelated, see also [gluebyte's SF Emoji Menu Builder](https://routinehub.co/shortcut/8841/) shortcut if you're looking for making pretty menus using SF icons. 228 | - [Toolbox Pro for Shortcuts](https://apps.apple.com/us/app/toolbox-pro-for-shortcuts/id1476205977) (Inspiration for the structure of Quick Menu feature and of menu items when a dictionary is used as input). 229 | - jpasholk wrote this description, and was pivotal in the preliminary design of this shortcut. 230 | 231 | ## Attribution 232 | 233 | If you use Menu Generator in any of your Shortcuts, please place a comment with the below text at or near the top of your Shortcut: 234 | 235 | > Menus created by Menu Generator by @twilsonco. 236 | 237 | If you publish your Shortcut to RoutineHub or any other Shortcuts sharing platform, please use this badge: 238 | 239 | ![Menu Generator Badge](https://github.com/twilsonco/SiriShortcuts/blob/main/img/made-with-menu-generator-badge.png?raw=true) 240 | 241 | ### You Can Copy This Markdown To Make It Easier 242 | 243 | ```![Menu Generator by @twilsonco](https://github.com/twilsonco/SiriShortcuts/blob/main/img/made-with-menu-generator-badge.png?raw=true)``` 244 | 245 | > Markdown for GitHub & RoutineHub created with ♥ by [jpasholk](https://routinehub.co/user/jpasholk). 246 | 247 | *** 248 | 249 | Thanks for stopping by, and if you have any questions don’t hesitate to reach out! 250 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SiriShortcuts 2 | 3 | ## 1. ChatGPT 4 | 5 | ### A. [I have a question](https://www.icloud.com/shortcuts/e01b052c382d44e09631dd5ba4a22e2d) 🔗 6 | 7 | * Starts a voice-only conversation with ChatGPT using the ChatGPT iOS/iPadOS app (does not work on macOS) 8 | * Using the ChatGPT app has the following advantages 9 | * A paid ChatGPT Plus account is optional, but you'll need at least a free ChatGPT account 10 | * If you do have a ChatGPT Plus subscription, you can optionally use GPT4 as the model 11 | * ChatGPT will remember previous messages as you continue your conversation 12 | * You can specify initial and followup system prompts in order to better control ChatGPT's behavior (as well as setup "custom instructions" in the ChatGPT app) 13 | * When run from lock screen, dictation of your prompt to ChatGPT will end automatically when a pause is detected 14 | * When run while unlocked, dictation will continue until you press the stop button ⏹️ 15 | * Shortcut can be modified to use OpenAI or ElevenLabs TTS by replacing the "Speak Text" action with "Run Shortcut" pointing to (2A) or (2B) below 16 | 17 | #### Known issues 18 | 19 | * The Shortcut may complain that you are not logged into the ChatGPT app, even though you are 20 | * The workaround is to simply rerun the Shortcut, which will work on subsequent runs 21 | * Every Shortcut using the ChatGPT app may have this same issue 22 | * Please let me know if you find a reliable solution for this; I've tried including a very short use of the "Ask ChatGPT" action so that its later use will always succeed, but any failure of the action causes the Shortcut to fail, so this approach doesn't work 23 | 24 | ### B. [I want to have a conversation](https://www.icloud.com/shortcuts/bd154f690837417cb81ede56f71448dc) 🔗 25 | 26 | * Similar to (1), but unlocks phone first in order to avoid some issues that happen on the lock screen (does not work on macOS) 27 | * Uses OpenAI TTS to read back response in a more natural voice (needs "Speak text with OpenAI" (2A) shortcut installed) 28 | * Can modify shortcut to use ElevenLabs TTS for reading back response if desired, or to use iOS built-in TTS 29 | 30 | ### C. [Weather summary](https://www.icloud.com/shortcuts/d844ac557277490cb8cf3d17abda5c8d) 🔗 31 | 32 | * Fetches weather data for your current location and have ChatGPT read back a natural language summary of the upcoming weather 33 | * Uses the ChatGPT app like (1), so does not work on macOS 34 | 35 | ### D. [Today's agenda and weather](https://www.icloud.com/shortcuts/37e039275d6f48cfa13d3acac46640b4) 🔗 36 | 37 | * [Same but for weekly agenda](https://www.icloud.com/shortcuts/76e8d60616164b779ae70ebafbcfea2e) 🔗 38 | * Define a list of iOS calendars and reminder lists which are used to fetch your scheduled events for the day, and have ChatGPT read back a summary of your agenda along with the weather 39 | * Uses the ChatGPT app like (1), so does not work on macOS 40 | 41 | ### E. [ChatGPT via API](https://www.icloud.com/shortcuts/236b0e751bbb4305b3303778a35eeabf) 🔗 42 | 43 | ([And voice-only version](https://www.icloud.com/shortcuts/7195e7369c3348fcb4995be71f3e2128)) 44 | 45 | * Drop-in replacement for the ChatGPT app's "Ask ChatGPT" Shortcut action 46 | * Provide text or a valid dictionary as input and use the OpenAI API to submit the text to ChatGPT as a prompt 47 | * Valid input dictionary contains optional keys “prompt”, “model”, “temperature”, and “apikey” 48 | * If run with no input, the Shortcut will ask for text input 49 | * Requires your own [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-api-key) 🔗 50 | * Includes back and forth conversation capability 51 | 52 | ### F. [Create calendar events](https://routinehub.co/shortcut/17514/) 🔗 53 | 54 | * Takes text (or an image/screenshot containing text), e.g. from an email client or Messages and uses ChatGPT to suggest one or more calendar events from the text content 55 | * You can choose which identified events will be added, and edit details beforehand if necessary 56 | * Messages and email clients suck at suggesting events; they're always incomplete and unhelpful and require additional user input. This lets ChatGPT improve the process by parsing out the necessary information automatically 57 | * Automatically populates 58 | * an appropriate event title 59 | * start/end time and all day status 60 | * location 61 | * url 62 | * an appropriate calendar 63 | * attendee list 64 | * notes with references to relevant part(s) of the text used for creating the event 65 | 66 | ### G. [Add work shifts to calendar](https://www.icloud.com/shortcuts/543ac4dc519e4bf0979cc2e93138f8ba) 🔗 67 | 68 | * Does your work send you your upcoming schedule in a text or email? (Those jerks...) 69 | * This shortcut will take that message and create calendar events with them automatically 70 | * Can be setup to run as an automation to be triggered by a text message/email, assuming the sending phone number or email address is consistent 71 | * If the message/email is an amended schedule, this will check for conflicts with previously created shifts and delete the old ones 72 | * Uses the "ChatGPT via API" shortcut (see E above) to make it more reliable, since it's meant to be run automatically. You can modify it easily to use the ChatGPT app instead. 73 | 74 | ## 2. Google Gemini Pro 75 | 76 | ### A. [Gemini via API](https://routinehub.co/shortcut/17624/) 🔗 77 | 78 | * Drop-in replacement for the "Ask ChatGPT" shortcut action, or 79 | * Runs standalone for voice/text/image/pdf/document/url/video-based Gemini requests 80 | * Logs conversations/images to Files App at `/Shortcuts/GeminiAPI` 81 | * Beautiful rich text display of Gemini response with ability to show entire conversation 82 | * [View/continue Gemini conversation with this companion shortcut](https://routinehub.co/shortcut/17671/) 🔗 83 | * Currently, Gemini-Pro API access is FREE for up to 15 queries per minute with 1.5-flash, or 2 per minute with 1.5-pro. 84 | 85 | ![Screenshots of the View/continue Gemini conversation companion shortcut](https://github.com/twilsonco/SiriShortcuts/blob/main/img/gemini_viewer_iOS.png?raw=true) 86 | 87 | ``` 88 | This shortcut is design to be run standalone or from other Shortcuts. It passes the input prompt to Google via their API and returns the response if successful. 89 | 90 | Input: Text (a prompt, possibly via Share Sheet), 91 | OR 92 | a valid Dictionary with optional keys, 93 | “prompt”, “messages”, “image”, “model”, “temperature”, “apikey”, “repeat”, “speak”, "datetime", and "disablelogging" 94 | OR 95 | nothing. If no prompt is provided, user will be asked to provide one before continuing. 96 | 97 | Output: A text string containing the bot response, OR an output dictionary containing “messages” and “output”. 98 | 99 | Setup: Can set default model, API key and temperature. 100 | ``` 101 | ``` 102 | Dictionary input arguments: 103 | “model” a valid model name to use. 104 | “temperature” a number between 0 and 105 | “messages” a JSON array passed as the “contents” to the API. You don’t have to build it manually, since it’spart of the output. Just maintain it between calls to the shortcut. (see https://ai.google.dev/tutorials/rest_quickstart#multi-turn_conversations_chat). 106 | “image” is a text string that is a base64-encoded image. 107 | “repeat” is 0 or 1 to control if this shortcut repeats automatically (ongoing conversation). 1 to repeat. 108 | “speak” is 0 or 1 to control if output is read aloud. 1 to speak. 109 | 110 | https://ai.google.dev/docs/concepts#model_parameters 111 | https://ai.google.dev/tutorials/rest_quickstart#configuration 112 | 113 | Dictionary output content: 114 | When a dictionary is used as input, this shortcut will output a dictionary with “output” string and “messages” JSON array that can be passed back into the shortcut. 115 | ``` 116 | 117 | ### B. [What is this?](https://routinehub.co/shortcut/17670/) 🔗 118 | 119 | * A simple example of a shortcut utilizing the “Gemini via API” shortcut. 120 | * This takes a picture and has gemini describe it. This is intended to be used via Siri or through a widget. 121 | 122 | ### C. [I have a question](https://routinehub.co/shortcut/17672/) 🔗 123 | 124 | * This shortcut allows you to have a voice-only, back-and-forth conversation with Google Gemini Pro, using the “Gemini via API” shortcut. 125 | * You can also pass this shortcut an image/photo via the share sheet and the image will be included with every request so you can query the same image repeatedly. (No previous messages are retained when an image is used, due to Google API constraints) 126 | 127 | ### D. [Weather summary](https://routinehub.co/shortcut/17674/) 🔗 128 | 129 | * Fetches weather data for your current location and have Gemini read back a natural language summary of the upcoming weather 130 | * Uses "Gemini via API" 131 | 132 | ### E. [Today's agenda and weather](https://routinehub.co/shortcut/17673/) 🔗 133 | 134 | * [Same but for weekly agenda](https://routinehub.co/shortcut/17675/) 🔗 135 | * Define a list of iOS calendars and reminder lists which are used to fetch your scheduled events for the day, and have Gemini read back a summary of your agenda along with the weather 136 | * Uses "Gemini via API" 137 | 138 | ## 3. AI Text-to-speech (TTS) 139 | 140 | ### A. [Speak text with OpenAI](https://www.icloud.com/shortcuts/c36c82b460af49faa84c7d35f361d7cc) 🔗 141 | 142 | * Drop-in replacement for the "Speak Text" Shortcut action using OpenAI's TTS voices to speak the text 143 | * Falls back to using the "Speak Text" action if it fails 144 | * Requires your own [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-api-key) 🔗 145 | * This shortcut was adapted from the [“Dispatch” shortcut by Nicololo Diamante](https://github.com/nicolodiamante/dispatch) 🔗 146 | 147 | ### B. [Speak text with ElevenLabs](https://www.icloud.com/shortcuts/74454f56a2f94deda842a29b438dfaa2) 🔗 148 | 149 | * Drop-in replacement for the "Speak Text" Shortcut action using ElevenLabs's TTS voices to speak the text 150 | * Falls back to using the "Speak Text" action if it fails 151 | * Requires your own [ElevenLabs API key](https://elevenlabs.io/docs/api-reference/authentication#) 🔗 152 | * This shortcut was adapted from the [“Dispatch” shortcut by Nicololo Diamante](https://github.com/nicolodiamante/dispatch) 🔗 153 | 154 | ## 4. OpenPilot navigation shortcuts 155 | 156 | * OpenPilot is an after-market level-II autonomous driving product by [Comma.ai](https://comma.ai) 🔗 157 | * It can now perform nearly full navigation from origin to destination, stopping for lights/signs, and performing turns completely unassisted 158 | * These Shortcuts simplify the process of setting a navigation destination 159 | * See the [separate repository for the Shortcuts here](https://github.com/twilsonco/OpenPilotSiriShortcuts) 🔗 160 | 161 | ## 5. Mobile Safari 162 | 163 | ### A. Open in Chrome 🔗 164 | 165 | * Use the [share sheet](https://www.idownloadblog.com/2020/04/21/customize-share-sheet-iphone-ipad/) 🔗 in Safari on iOS/iPadOS to open the current website in the Google Chrome app 166 | 167 | ## 6. macOS Shortcuts 168 | 169 | ### A. Activate/deactivate head pointer 170 | 171 | * Two Shortcuts to activate or deactivate the [head pointer feature of macOS](https://support.apple.com/en-gb/guide/mac-help/mchlb2d4782b/mac#:~:text=Turn%20on%20and%20customize%20head%20pointer&text=Go%20to%20Motor%20on%20the%20right%2C%20then%20click%20Pointer%20Control.&text=Turn%20on%20“Head%20pointer.”,and%20which%20camera%20to%20use.) 🔗 that lets you move/click the mouse using the direction of your head and facial gestures 172 | * First, visit the head pointer settings to configure them to your liking 173 | * Install links: 174 | * [Activate head pointer](https://www.icloud.com/shortcuts/adb89eacf53c4ecb957650e8d93df1a3) 🔗 175 | * [Deactivate head pointer](https://www.icloud.com/shortcuts/8ea48a269ac84d02b6cbed5989ce1d3c) 🔗 176 | 177 | ### B. Restart/shutdown Mac 178 | 179 | * With MacBooks with Touch ID, or when using the Magic Keyboard with Touch ID, the classic keyboard shortcuts to sleep/restart/shutdown a Mac or turn off the display no longer work 180 | * These two Shortcuts at least provide the ability to perform a restart or shutdown, per [my answer on Apple Stack Exchange](https://apple.stackexchange.com/a/464996/85762) 🔗 181 | * After installing, you'll need to setup keyboard shortcuts to trigger the shortcuts 182 | * Install links: 183 | * [Restart Mac](https://www.icloud.com/shortcuts/92d8a4d8a11c4f21869e8a37180e8132) 🔗 184 | * [Shutdown Mac](https://www.icloud.com/shortcuts/714cbb1e3ff642be86a356315955adcc) 🔗 185 | 186 | ## 7. Other 187 | 188 | ### A. [Reminders to PDF](https://routinehub.co/shortcut/17512/) 🔗 189 | 190 | * You specify one or more Reminders lists along with number of past/future days to include, and when run, the shortcut produces a nicely formatted PDF that contains all reminders in the specified lists, one PDF per list 191 | * Shows most pertinent reminder data *if present*: title, name (if different from title), notes, completed, priority, flagged, tags, location (macOS only due to a bug in iOS), URL, images, and subtasks 192 | * Works with repeat reminders, showing next due instance of the repeat reminder and the count of completed instances 193 | * Here's what the resulting PDF looks like 194 | 195 | ![](img/ReminderPDF.png) 196 | 197 | ### B. [Photo collage](https://routinehub.co/shortcut/17870/) 198 | 199 | * Makes beautiful photo collages from the specified photos on iOS/iPadOS/macOS 200 | * This is a vanilla shortcut with the same functionality as (and that runs 10X slower than) my [PyPhotoCollage](https://github.com/twilsonco/PyPhotoCollage) prgrogram 201 | 202 | ### C. [Photo mosaic](https://routinehub.co/shortcut/18978/) 203 | 204 | * Create beautiful photo mosaics from photos/videos on iOS/iPadOS/macOS 205 | * Advanced, multi-point tile matching for highest quality mosaid 206 | * Control over repeated mosaic tiles to reduce overuse of same tile 207 | 208 | ### D. [Multi-stop navigation](https://routinehub.co/shortcut/18833/) 209 | 210 | * Optimize multi-stop routes by solving the travelling salesman problem 211 | * Optimize by travel time or distance 212 | * Supports driving/biking/walking/transit navigation 213 | * Supports Apple Maps, Google Maps, and Waze 214 | -------------------------------------------------------------------------------- /dup.md: -------------------------------------------------------------------------------- 1 | 2 | ![banner](https://github.com/twilsonco/SiriShortcuts/blob/main/img/dup_1banner.png?raw=true) 3 | 4 | This shortcut uses [perceptual hashing](https://benhoyt.com/writings/duplicate-image-detection/) to quickly find duplicate or similar images in Photos or in Finder on a Mac. 5 | 6 | Then it guides you through the cleanup process to remove duplicates, or organizes them into albums or folders so that you can review and delete duplicates easily. 7 | 8 | ![2](https://github.com/twilsonco/SiriShortcuts/blob/main/img/dup_2selection.png?raw=true) 9 | 10 | ![2](https://github.com/twilsonco/SiriShortcuts/blob/main/img/dup_3search.png?raw=true) 11 | 12 | ![2](https://github.com/twilsonco/SiriShortcuts/blob/main/img/dup_4clean.png?raw=true) 13 | 14 | ![2](https://github.com/twilsonco/SiriShortcuts/blob/main/img/dup_5config.png?raw=true) -------------------------------------------------------------------------------- /img/MediaKitCred.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/MediaKitCred.PNG -------------------------------------------------------------------------------- /img/Mosaic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_banner.png -------------------------------------------------------------------------------- /img/Mosaic_color space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_color space.png -------------------------------------------------------------------------------- /img/Mosaic_examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_examples.png -------------------------------------------------------------------------------- /img/Mosaic_grid size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_grid size.png -------------------------------------------------------------------------------- /img/Mosaic_long and tall images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_long and tall images.png -------------------------------------------------------------------------------- /img/Mosaic_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_progress.png -------------------------------------------------------------------------------- /img/Mosaic_tile matching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_tile matching.png -------------------------------------------------------------------------------- /img/Mosaic_tile subdivision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_tile subdivision.png -------------------------------------------------------------------------------- /img/Mosaic_tile useage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/Mosaic_tile useage.png -------------------------------------------------------------------------------- /img/ReminderPDF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/ReminderPDF.png -------------------------------------------------------------------------------- /img/TSP_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/TSP_features.png -------------------------------------------------------------------------------- /img/TSP_permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/TSP_permissions.png -------------------------------------------------------------------------------- /img/TSP_routing_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/TSP_routing_map.png -------------------------------------------------------------------------------- /img/TSP_share sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/TSP_share sheet.png -------------------------------------------------------------------------------- /img/ThinkBuddy chat viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/ThinkBuddy chat viewer.png -------------------------------------------------------------------------------- /img/auto unsub automation1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub automation1.png -------------------------------------------------------------------------------- /img/auto unsub automation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub automation2.png -------------------------------------------------------------------------------- /img/auto unsub logged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub logged.png -------------------------------------------------------------------------------- /img/auto unsub method1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub method1.png -------------------------------------------------------------------------------- /img/auto unsub method2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub method2.png -------------------------------------------------------------------------------- /img/auto unsub test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/auto unsub test.png -------------------------------------------------------------------------------- /img/dup_1banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_1banner.png -------------------------------------------------------------------------------- /img/dup_2selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_2selection.png -------------------------------------------------------------------------------- /img/dup_3search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_3search.png -------------------------------------------------------------------------------- /img/dup_4clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_4clean.png -------------------------------------------------------------------------------- /img/dup_5config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_5config.png -------------------------------------------------------------------------------- /img/dup_collage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/dup_collage.png -------------------------------------------------------------------------------- /img/gemini_dropin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_dropin.png -------------------------------------------------------------------------------- /img/gemini_file_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_file_types.png -------------------------------------------------------------------------------- /img/gemini_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_image.png -------------------------------------------------------------------------------- /img/gemini_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_pdf.png -------------------------------------------------------------------------------- /img/gemini_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_tests.png -------------------------------------------------------------------------------- /img/gemini_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_text.png -------------------------------------------------------------------------------- /img/gemini_viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_viewer.png -------------------------------------------------------------------------------- /img/gemini_viewer_iOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_viewer_iOS.png -------------------------------------------------------------------------------- /img/gemini_viewer_macOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/gemini_viewer_macOS.png -------------------------------------------------------------------------------- /img/made-with-menu-generator-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/made-with-menu-generator-badge.png -------------------------------------------------------------------------------- /img/menu-generator-advanced-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-advanced-menu.png -------------------------------------------------------------------------------- /img/menu-generator-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-banner.png -------------------------------------------------------------------------------- /img/menu-generator-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-example.png -------------------------------------------------------------------------------- /img/menu-generator-font-awesome-site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-font-awesome-site.png -------------------------------------------------------------------------------- /img/menu-generator-hero-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-hero-image.png -------------------------------------------------------------------------------- /img/menu-generator-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-permissions.png -------------------------------------------------------------------------------- /img/menu-generator-quick-menu-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/menu-generator-quick-menu-example.png -------------------------------------------------------------------------------- /img/photo_collage_video_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/photo_collage_video_thumb.png -------------------------------------------------------------------------------- /img/powered by gemini via api.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/powered by gemini via api.PNG -------------------------------------------------------------------------------- /img/powered_by_pro_ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/powered_by_pro_ai.png -------------------------------------------------------------------------------- /img/social_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/social_banner.png -------------------------------------------------------------------------------- /img/view-continue-gemini-convo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilsonco/SiriShortcuts/26dfdb432d9ca81a8b4dc52f99a0501798df1e39/img/view-continue-gemini-convo.png -------------------------------------------------------------------------------- /mosaic_readme.md: -------------------------------------------------------------------------------- 1 | ![banner](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_banner.png?raw=true) 2 | 3 | A photo mosaic is a picture made out of smaller pictures. This shortcut creates a photo mosaic from a subject image and a library of smaller images. The subject image is divided into a grid of tiles, and each tile is replaced with a smaller image from the library that best matches the original tile. The result is a mosaic that looks like the subject image from a distance, but is made up of smaller images up close. 4 | 5 | # Notes/Limitations 6 | 7 | - 100% vanilla shortcut, utilizing built-in JavaScript support to perform advanced mosaic tile color matching 8 | - If the shortcut crashes ("There was a problem running Photo mosaic"), try preprocessing mosaic tiles (step 2) to lower image size 9 | - I won't tell you _how_ to use this tool, but if you want my opinion, a good mosaic requires more than just a large tile library and a subject image. The subject image should have a good balance of colors and contrast, and should be a "good" image/photo; ideally something meaningful. Then the tile library should be able to reproduce the colors and contract of the subject image, but should also contextually match the subject image. For example, a mosaic of the moon made from images from NASA's Apollo missions, or from other space images. [Here's a blog post on what makes a good mosaic.](https://intellithoughts.wordpress.com/2011/03/08/photo-mosaic-tips/) 10 | 11 | # Instructions 12 | 13 | 1. Collect a dozen or more images to use as a mosaic tile library. It takes hundreds of unique tiles to create a nice-looking mosaic, but you can get by with just a dozen or so thanks to the optional tile subdivision feature in step 2. You can store these in a photo album in the Photos app or optionally, for macOS users, in a folder on your computer. 14 | 2. Preprocess mosaic tiles. This step converts the images you collected in step 1 into smaller, square tiles. If your tile library is very small (fewer than 70-100 tiles), consider using the "stacked" subdivision option to create more unique tiles from the library you've prepared. When you're done, the preprocessed tiles will be saved to a new photo album or optionally, for macOS users, to a folder on your computer. 15 | 3. Specify subject image, mosaic grid size, tile-matching color space, and **_one or more tile libraries_**. The subject image is the image you want to convert into a mosaic. The mosaic grid size is the number of tiles that will be used to represent the subject image. The tile-matching color space is the color space used to compare the colors of the subject image and the tiles in the library. The tile library is the photo album or folder containing the preprocessed tiles from step 2. 16 | 4. That's it! The mosaic will be created, and you'll be prompted to view/save the result. 17 | 18 | # Credits 19 | 20 | - Used @atnbueno's [Autocrop Screenshot Stitcher](https://routinehub.co/shortcut/17347/) as inspiration for being able to perform pixel-level image analysis in JavaScript in a shortcut. 21 | 22 | # Features 23 | 24 | - **_Preprocess tile library_** from full size images to smaller, square tiles. This step isn't strictly necessary, but is strongly recommended to improve output quality and performance. You may also experience crashes due to memory limitations if you don't preprocess tiles. 25 | 26 | ![grid size](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_grid%20size.png?raw=true) 27 | 28 | - The mosaic **_grid size_** can be adjusted to create a more detailed or more abstract mosaic. 29 | 30 | ![tile subdivision](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_tile%20subdivision.png?raw=true) 31 | 32 | - **_Subdivide tiles_** to create more unique tiles from a small tile library. This is "cheating" but who will know? As the image below shows, using subdivision improves the quality of the mosaic, even when the same mosaic grid is used. In the image below, a tile library of only 16 images was used, but the quality of the mosaic after maximum subdivision still looks good. Of course, it's better to have a larger tile library of truly unique tiles, but this feature can help you get by with fewer tiles. 33 | 34 | ![long and tall tile images](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_long%20and%20tall%20images.png?raw=true) 35 | 36 | - **_Handling of long/tall images_**. When preprocessing the tile library, the shortcut will make the most of long/tall images by creating multiple tiles from them. This is performed regardless of subdivision setting. The result is one square tile centered on the long/tall image, and additional tiles starting from the left/top of the image. 37 | - When a long/tall image is subdivided, the subregions are also long/tall. Those are also subdivided in this way so that no part of the original image goes to waste. 38 | 39 | ![multi-point tile matching](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_tile%20matching.png?raw=true) 40 | 41 | - **_Multi-point tile matching_**. Rather than simply finding the tile whose average color best matches that of the each mosaic tile, the shortcut uses a more sophisticated, optimized, algorithm to compare multiple points in each library tile to find the best match. 42 | 43 | ![color spaces](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_color%20space.png?raw=true) 44 | 45 | - The **_tile-matching color space_** can be chosen from four options 46 | - [(CIE)LAB](https://www.datacolor.com/business-solutions/blog/what-is-cielab): A color space that approximates human vision 47 | - [HSV](https://www.lifewire.com/what-is-hsv-in-design-1078068): A color space that separates color into hue, saturation, and value, which can be useful for matching colors that are similar but have different brightness 48 | - RGB: The standard color space used in digital images 49 | - [RGB+](https://www.compuphase.com/cmetric.htm): RGB enhanced with a gamma correction to make it more perceptually uniform 50 | 51 | ![progress indication with remaining time and mosaic preview](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_progress.png?raw=true) 52 | 53 | - **_Progress indication_**. The shortcut will show you progress notifications as it performs long tasks. When creating the mosaic, the progress notifications will also show a preview of the mosaic so you can see how it's coming along. 54 | 55 | ![tile usage](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_tile%20useage.png?raw=true) 56 | 57 | - **_Visualize tile usage in the mosaic_**. After a mosaic has been created, you can save/view the results, as well as generate a visualization of the tile usage in the mosaic. This visualization shows the tiles used in the mosaic, and how many times each tile was used. This can be useful for identifying tiles that are overused. When a tile is overused, you can add similar unique images to the tile library to give the shortcut perhaps more options to choose from. 58 | - **_Additional expert options_**: Open the shortcut to find the configuration dictionary at the top. Here you can modify default values, and access some additional options that are not exposed in the shortcut's main interface. 59 | - **_Debug logging_**: If you're having trouble with the shortcut, you can enable debug logging in the configuration dictionary to get more information about where the problem occurs. This is especially helpful if you want to ask for support using the shortcut. 60 | 61 | ## Example log output 62 | 63 | ```log 64 | 2024-06-23 16:26:10 Starting on Mac (macOS 14.5) 65 | 2024-06-23 16:26:13 Mac user selecting subject image... 66 | 2024-06-23 16:26:25 User running image with output mosaic size = 5000 and grid size = 30, comparing in the LAB color space. User now selecting mosaic tile image album(s)... 67 | 2024-06-23 16:26:33 Precomputing image colors for 225 tiles in 3 batches. Resizing to thumbnails of size 49 and then using a 7x7 sampling grid. 68 | 2024-06-23 16:26:33 Processing batch 1 of 3... 69 | 2024-06-23 16:26:35 Processing batch 2 of 3... 70 | 2024-06-23 16:26:37 Processing batch 3 of 3... 71 | 2024-06-23 16:26:38 Finished precomputing color grids for tiles. Now running JS routine to segment subject image and match with tiles. Precomputed average color grid: [[[79,-3,3],[51,-14,9],[36,-20,13],[37,-21,14],[36,-19,12],[35,-20,12],[36,-19,1...[17,-17,19],[19,-15,12],[24,-16,11],[35,-16,8],[39,-17,7],[38,-18,7],[37,-17,6]]] 72 | 2024-06-23 16:26:41 JS routine finished. Now assembling mosaic. Normalized mean distance: 0.149425610026727. Solution dictionary: {"24,1":170,"1,27":26,"26,14":135,"15,10":87,"26,22":112,"3,36":26,"24,2":170,"2...:182,"13,39":35,"26,13":115,"10,9":108,"26,21":23,"3,34":26,"1,26":182,"3,35":26} 73 | 2024-06-23 16:26:41 Processing row 1 of 30... 74 | ... 75 | 2024-06-23 16:26:54 Processing row 21 of 30... 76 | 2024-06-23 16:26:55 Sending progress notification... 77 | 2024-06-23 16:26:55 Processing row 22 of 30... 78 | ... 79 | 2024-06-23 16:27:01 Processing row 30 of 30... 80 | 2024-06-23 16:27:01 Finished combining rows. 81 | Now combining rows into final image. 82 | Cache usage was 95.4%. 83 | Used 55 unique tiles out of 225. 84 | Making a 40x30 = 1200 tile mosaic of size 5000x3750. 85 | Comparing by LAB color. 86 | 2024-06-23 16:27:02 Finished with mosaic. Preparing comparison image and prompting user. 87 | Timing: 88 | 5s to process tile library 89 | 45 tiles per second 90 | 1s to compute best matches for mosaic 91 | 270000 tile checks per second 92 | 22s to construct mosaic 93 | 54.5 mosaic tiles per second 94 | 2024-06-23 16:27:10 User quit. 95 | ``` 96 | 97 | # Examples 98 | 99 | ![examples](https://github.com/twilsonco/SiriShortcuts/blob/main/img/Mosaic_examples.png?raw=true) 100 | 101 | # Want an app instead? 102 | 103 | | Name | Price | 104 | | ----- | ----- | 105 | | [Photo Mosaica](https://apps.apple.com/us/app/photo-mosaica/id437992891) | $0.99 to unlock deluxe features | 106 | | [Pro Photo Mosaic Creator](https://apps.apple.com/us/app/pro-photo-mosaic-creator/id1219025715) | Free | 107 | | [mosaicPro: Photo Mosaic App](https://apps.apple.com/us/app/mosaicpro-photo-mosaic-app/id1616212938) | $9.99 to unlock full app | --------------------------------------------------------------------------------