Categories
Posts Scriptable Shortcuts

Tesla Shortcuts and Scriptable Widgets

Despite my keen interest in iOS automation apps like Shortcuts, I must admit that I hadn’t spent any meaningful time with Scriptable, a powerful automation app that uses JavaScript. It’s far more versatile than Shortcuts though requires knowledge and experience with JavaScript to really take advantage of it.

Scriptable popped up on my radar not long after the release of iOS 14 due to its rich support for widgets. Scripts have complete control over the widget’s appearance and can present whatever information you’d like. Scriptable even refreshes widgets in the background so they can be kept up-to-date.

I recently purchased a Tesla Model 3 and have been tinkering with the Tesla API in Shortcuts. (Although this is Tesla’s API, it’s not officially available to third-parties. The Tesla community has been reverse-engineering and documenting it for years). This was also a good opportunity to learn more about Scriptable.

I’ve created a set of shortcuts to to control and get details about my Tesla, along with some Scriptable widgets to provide at-a-glance information on my iPhone’s home screen.

Tesla’s API requires an access token for authentication. One of the shortcuts generates this token using your Tesla login credentials, then saves it to iCloud Drive for all shortcuts to reference. Your password is not saved at any point and is only used to create the token with Tesla’s API.

One notable feature of both the shortcuts and scripts is that, where necessary, it automatically converts distance and temperature based on your car’s preferred units of measurement. Tesla’s API uses miles and Celsius, an oddly British combination of metric and imperial, so any conversion is done for kilometers and Fahrenheit automatically.

I plan to spend more time with Scriptable and have set up a GitHub repository for my scripts.

Categories
Shortcuts

Shortcuts Wishlist

Shortcuts has gained plenty of features and functionality over the years, especially after Apple’s acquisition of Workflow, but how shortcuts are created and organized has remained almost unchanged since the app first launched back in 2015.

As a result, creating shortcuts like Mocktail is a painstaking and frustrating process. The app simply hasn’t scaled with the increasingly complex uses for shortcuts and the interface is still skewed towards simple shortcuts made up of only a few actions.

After spending what felt like an eternity updating Mocktail, I’ve come up with a wishlist of ten improvements I’d love to see in Shortcuts.

Copy actions

Shortcuts desperately needs a way to copy and paste actions across shortcuts—it’s almost criminal that it doesn’t have it already. There’s simply no way to reuse a set of actions from one shortcut in another or even just duplicate actions within the composer.

Copy action mockup

As I rewrote parts of Mocktail, I made use of a separate iPad to view a set of actions I had created in another shortcut, then manually add them to the shortcut I was working on.

Backup and versioning

There’s no way to easily back up shortcuts, which feels like a regression and something that was possible with Workflow (i.e., saving workflows as files). iCloud syncing helps keep devices in sync but it’s not a backup tool. I often duplicate shortcuts at various stages of development (Mocktail 1, Mocktail 2, Mocktail 3, etc.), all of which clutter the app.

This is even after I cleaned out older copies

One workaround is to create a shortcut that contains the Get My Shortcuts and the Get Link to File actions to create an iCloud link for every shortcut. This is time consuming as a new iCloud link is generated every time it’s run and the more shortcuts you have, the longer it takes.

A feature I’d really like to see is a macOS Time Machine approach to backups that supports versioning. I’ve lost count of how many times I’ve started to make changes to a shortcut, only to realize I want to revert some of my changes. I can’t do that and, unless I’ve duplicated the shortcut at a specific point in time, it’s too late. Being able to create a snapshot of a shortcut—or more easily back it up without the need to create an iCloud link—is something that’s sorely needed.

Versioned shortcuts mockup

Share shortcuts as files

As I mentioned above, Workflow previously supported sharing workflows as files. I used this extensively and it made hosting my workflows on GitHub possible—I didn’t have to rely on web links to share them. This also made it easy to back up workflows. At one time, I had a very simple workflow that would create a timestamped folder of all my workflows on iCloud Drive.

Shortcuts, however, cannot be shared as files and the only option is to create iCloud links. I understand the security concerns here and, honestly, I don’t see this feature ever returning. Nonetheless, it still something I wish it supported… again.

Revamped organization of shortcuts

Despite Shortcuts and Workflow improving significantly over the years, the way shortcuts are organized has barely changed. The most notable improvements I can think of were the addition of search and the ability to tap the Shortcuts button to jump to either the top or bottom of the list.

No way of grouping or organizing shortcuts is a significant user experience problem, one that gets worse the longer you use the app. Many of us seasoned Shortcuts users can easily have over 100 shortcuts, especially if you’re duplicating because there’s no versioning or backup support. Some form of navigable grouping, whether through folders or tags, for example, would improve things significantly.

Subroutines

Shortcuts technically supports this in some fashion as a shortcut can run another shortcut within itself by using the Run Shortcut action. But to do this, another shortcut has to exist. This is problematic for two reasons:

  • You can’t share just the main shortcut, you have to also share any other shortcuts it references or else it won’t work.
  • It’s not something that scales well. The more shortcuts you create like this, the more cluttered Shortcuts becomes (there’s a theme about organization developing here).

I have a few shortcuts for image manipulation and each one runs additional shortcuts to resize and optimize the images (using TinyPNG) passed to it. I’d much rather have a subroutine for optimizing images with TinyPNG than a normal shortcut that isn’t used independently.

Subroutines could be mini-shortcuts that don’t exist within the standard set of shortcuts, instead they could be accessed like actions. Sharing a shortcut should also include a full copy of the subroutine. This type of reuse would, I think, be highly useful.

Breakpoints

There are times during shortcut development that I’d like to stop or pause a shortcut at a particular place. I currently do this with the Show Alert action but would prefer an option to do this without having to tap cancel.

Beyond this, having the ability to pause a shortcut, see what the input and output of the previous action, and even changing subsequent actions before resuming would rapidly speed up my work.

Sandbox

Sometimes I just need a shortcut for a one-off task or I want to try something out. This slowly results in a litter of untitled shortcuts that are either empty or were needed only once. Although Shortcuts does provide an option to either save or delete shortcuts that haven’t yet been named, I wish there was a sandbox for these quick one-off needs instead of creating a new shortcut first. Once I’m finished, I could then choose to save the shortcut or just clear the sandbox.

Improved dictionary support

Dictionary support is pretty good in Shortcuts but it’s hindered by limited functionality and a lack of flexibility. I’d like to see things like:

  • a collapsible tree view for nested dictionaries.
  • the ability to copy and paste keys and values.
  • an option to populate or load a dictionary from a JSON file.

Exit to home screen

The Exit Shortcut action is limited to stopping the current shortcut and then dismissing it. This is fine but sometimes I run a shortcut and would prefer an option to exit the app entirely and return to the Home screen.

Don’t show in Widget by default

Oh boy, do I hate this behavior. I’ve stopped using the Widget entirely because it’s full of duplicate shortcuts. Perhaps this wouldn’t be so bad if there was a better way to back up and version shortcuts?

Categories
Shortcuts

Major Update to My Mocktail Shortcut

I’ve made a significant update to Mocktail, my shortcut for creating device-framed screenshots. It now (finally) includes base images for:

  • iPhone 11
  • iPhone 11 Pro
  • iPhone 11 Pro Max
  • iPhone SE
  • iPad Pro Magic Keyboard

There are also more base images available for a number of supported devices. The shortcut has also been updated to be much more reliable and efficient, with around 30 fewer actions than before.

Finally, the shortcut and its required base images are now hosted here. If you have any questions, problems, or feedback, please leave a comment on the shortcut’s page or let me know.

Categories
Shortcuts

An Update on My Shortcuts

One of my favorite features of Workflow was its ability to share workflows as files. It was this functionality that made it possible for me to start Workflow Directory and create my own GitHub repository of workflows. Unfortunately, Shortcuts doesn’t support this functionality and I suspect it never will again.

Although it’s possible to jump through some hoops to import workflow or shortcut files, lack of file support makes it impossible to maintain my GitHub repository. Instead, I’ve started the long overdue process of creating iCloud links to my shortcuts and publishing them here instead.

All of my shortcuts are being made available on my site and can be found at a dedicated Shortcuts page. Although I’ve written about some of them in more detail, there are plenty of shortcuts I’ve never blogged about. I will publish any shortcuts I think are useful and continue to write about some of them in more detail.

I’m also using this opportunity to clean up my shortcuts, fix any broken ones, and remove any that are no longer functional. I’ve already gone through my blog posts to update them all with iCloud links and have identified a few that rely on APIs or functionality that’s no longer available (e.g., all my IFTTT-based workflows can’t be used anymore).

Categories
Posts Shortcuts

Resolving Shortcuts Sync Issues in iOS 13

I’ve been having some troublesome sync issues with Shortcuts since upgrading to iOS 13. None of my devices would stay in sync and shortcuts I’d delete would reappear moments later. In some cases, shortcuts would even be duplicated.

A helpful tip on the Shortcuts subreddit has provided a simple solution for my syncing woes: delete the app and reinstall it. I did this on each of my devices and now shortcuts sync perfectly.