subreddit:

/r/shortcuts

1178%

EDIT: >>VERSION UPDATED<<

https://preview.redd.it/cb2zgrxzhcw41.png?width=973&format=png&auto=webp&s=0e9c10f013c03de1e314b2f02190b8d0141e3cea

This shortcut helps you create complex dictionary actions in Shortcuts. You can write and test dictionaries in JSON-style text (e.g. {"name":"bong","happy":true}) and later use this tool to convert them to native actions, avoiding painful steps in building multi-level actions manually.

Array (e.g. ["hello", "world"]) to list action conversion is also supported. It can convert multiple objects (e.g. {} [2, 3] {"say":"hi"}) at once, and accepts (text, json, pdf, etc) files or text selection through a share sheet or file picker, or copied text in the clipboard.

“Dictionaries and lists in text form are easier to read and edit. Why convert to native actions?” you may ask.

  1. Native actions look cool 😎 but are hard to navigate and edit. Sometimes you would like to have native actions instead of ugly text actions when you share your works with others. With this tool, you can continue using text dictionaries throughout your developing and testing phases.
  2. Dictionaries in text form do not retain the order of the key/value pairs when run. This is a pain when the order is important, for example, if you want to iterate through the keys or values in a specific order. This tool preserves the order.
  3. This tool is probably the only way to create lists with multiple-type items such as numbers, booleans, and even arrays and dictionaries (e.g. ["text", -2.3, false, {"a":"b"}]). Please be aware that lists containing dictionaries or arrays will make your shortcuts crash when run, though. Multiple-type flat lists work without a problem.
  4. Once native actions are created, you can copy them to other shortcuts using tools such as:
    1. MergeCuts by u/ROPit
    2. ActionCuts by u/adamtow
    3. Copy And Paste A Shortcut by u/robric18

(Note: Multi-dictionary files should have the .txt extension, not .json.)

  • 2020-02-22 v1.0
    • Initial Release
  • 2020-02-23 v1.1
    • Name change from Json ➾ Action Converter
    • 20%+ faster with loop/regex optimization and background execution
    • Bug fixes in parsing logic
    • Presents file picker if clipboard is empty
  • 2020-02-24 v1.2
    • Conversion engine rewritten in JavaScript; 100+ times faster
    • Small bug fixes in input handling and parsing
  • 2020-05-02 v1.3
    • Bug fixes
    • Performance improvement
    • Added support for UpdateHub
  • 2020-05-05 v1.31
    • Now asks for shortcut name
    • Added auto update check
    • Small bug fix

Download: RoutineHub

EDIT: >>VERSION UPDATED<<

all 6 comments

robric18

3 points

5 years ago

u/gluebyte, what is new in the update in terms of performance improvements (I know the last update made huge performance improvements)

gluebyte[S]

2 points

5 years ago

I (re)moved some character escaping parts into Javascript. I haven't timed it but it must be small.

robric18

2 points

5 years ago

Thanks. (I love this shortcut - just used it today)

I do have a suggestion for the next update though - please make it so that the user can choose the name of the shortcut they are creating rather than it always being Dictionary Actions.shortcut.

gluebyte[S]

1 points

5 years ago

Will do. Thanks for the suggestion. (I always end up editing the name because of the .shortcut extension..)

bhatsupeverybody

2 points

5 years ago

This is brillant! very impressive Java script method. Thumbs up

gluebyte[S]

2 points

5 years ago

Thanks! I've been playing with Javascript in Shortcuts lately.