Jellycuts / Jellycuts-Issues

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

global variable Ask behaves differently than stated in online documentation #115

Open stepbro-im-stuck-in-vim opened 2 years ago

stepbro-im-stuck-in-vim commented 2 years ago

What action is the issue?

Global Variable Ask: Setting a variable to Ask with syntax from online documentation.

Describe the bug

From online documentation the global variable Ask is shown to work with: var answer = Ask However when imported to Shortcuts variable answer is set to an empty input and no user-prompt is raised.

The following syntax raises a prompt for text: ’var answer = ”${Ask}”

Similarly the syntax below behaves differently than seemingly intended by the online documentation ’ ”Hello ${Ask}” ’ As user is given a prompt to edit the whole string, not just the variable asked

Steps To Reproduce

the following code compiles without raising an error and can be imported to shortcuts


 import Shortcuts
#Color: red, #Icon: shortcuts
//this works
var p = "${Ask}"
//this syntax copied from online documentation of Ask does not
var q = Ask

//instead of raising alert, now variable q is set to en empty input

alert(title: "variable q is", alert: q)
alert(alert: p, title: "variable p is")

//User can delete the following string
alert(alert: "please do not delete this string ${Ask}") 

Information

Additional context

I just installed the aplication, so I can’t sure if the online documentation is simply unclear or outdated, or if this behaviour is unintended.

I’d also suggest adding more through-out explanation of global variables in the documentation inside the app, that explains the behaviour of them individually

ActuallyTaylor commented 2 years ago

This is an unintended behavior, do you see this happening with any of the other Global Variables or just Ask?

ActuallyTaylor commented 2 years ago

Okay so after some research. This appears to actually be an issue on Shortcuts end. The shortcuts app no longer supports asking for the value of a variable in the set action.

There are two steps forward for this:

  1. Add a check in jellycuts that will error out when you of var x = Ask
  2. Automatically convert var x = Ask into var x = “${Ask}

Which one do you think will be best?