Jellycuts / Jellycuts-Issues

A public issue tracker for the Jellycuts iOS app.
23 stars 0 forks source link

Magic variables with the same name after import #94

Closed atnbueno closed 2 years ago

atnbueno commented 3 years ago

When importing a shortcut, the output of each action/function is assigned to a magic variable named after the function. If the same action/function is used more than once in the shortcut, the compiler will complaint about repeated names ("text", "text", "text", ...).

The easiest solution I can think is to add a number at the end of the magic variable name ("text1", "text2", "text3", ...).

Ideally we would get the original name of each action output ("Contents of Web Page" instead of "urlContents"), but that is locale-dependant ("Text", "Texto", "Texte", ...).

atnbueno commented 3 years ago

An additional detail: Shortcuts allows magic variables with the same name, but that's a significant source of mistakes, especially if you copy and paste or duplicate actions. I'm all in favor of not allowing them.

ghost commented 3 years ago

The optimal and easiest solution in my opinion, would just be to grab the UUIDs and use those as names, but this wouldn't be very readable. Another nice option would be to refactor and change all instances of x to y

ActuallyTaylor commented 2 years ago

Fixed for version 1.4. Magic variables will now increase sequentially