matyalatte / tuw

Tiny GUI wrapper for command-line tools
MIT License
23 stars 2 forks source link

Reuse a component input in the command. #45

Open narknon opened 2 weeks ago

narknon commented 2 weeks ago

I'd like to be able to ask someone to input a number once (e.g., 99) and use it in the 3 places the command requires the pakchunk name. I couldn't figure out any syntax to reuse an input component.

matyalatte commented 2 weeks ago

Hi, you can use id to name components.

{
    "label": "IDs",
    "command": "echo %x% %x% %x%",
    "components": [
        {
            "type": "text",
            "label": "Value of x",
            "id": "x"
        }
    ]
}

ids

narknon commented 1 week ago

Awesome, thank you.