Prompt Command - use variable as default value

Thanks for the new Prompt command!

I’m trying to use a variable as the default value. Is that possible? If it is, can you tell me what I’m doing wrong in this sample?

{
  "Command": "prompt",
  "Target": "Enter Task ID@${globalTaskSearch}",
  "Value": "globalTaskSearch"
}

SHORT BACKGROUND: Before the Prompt was available, I was storing the Clipboard value to the globalTaskSearch variable. So now, I want to leave the clipboard value and let the user override it if needed. This didn’t work either.

{
  "Command": "prompt",
  "Target": "Enter Task ID@storedVars['!clipboard'] .trim()",
  "Value": "globalTaskSearch"
}

If it’s not possible, I will probably switch to using the Prompt command and ignore the clipboard value.

Thanks

In my test I can use a variable as default value:

  • store | 123 | var
  • prompt | hello@${var} | var2

Does this work for you? Maybe you forgot to define your variable? :wink:

{
  "Command": "store",
  "Target": "123",
  "Value": "ddd"
},
{
  "Command": "prompt",
  "Target": "hello abc@${ddd}",
  "Value": "kkk"
},

Hi @ulrich,

I must’ve been doing something wrong. Using variables does work fine.

If I use your example, the default value showing up on the prompt was ${ddd} instead of 123 (so in my case ${globalTaskSearch} was showing up instead of the clipboard value I stroed in the variable).

However, I tried your code now and re-did my code and both work fine. I even get null come up if the clipboard is empty. I wish I had saved the code I posted earlier so I could see what I did wrong. Funny thing is I cut and paste the code into the forum and it looks fine.

Anyway, thanks for the very prompt response.