Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stepbro-im-stuck-in-vim opened this issue May 23, 2022 · 2 comments
Labels

Comments

@stepbro-im-stuck-in-vim

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

  • Device: iPhone 7
  • OS: iOS 15.4.1
  • Jellycuts Version 1.3.3(0)

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

@stepbro-im-stuck-in-vim stepbro-im-stuck-in-vim added Action Parsing bug Something isn't working labels May 23, 2022
@ActuallyTaylor
Copy link
Member

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

@ActuallyTaylor
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants