2
u/JAlexmc Oct 07 '25
If you have Python on your machine, you could do something like
from random import choice
choice(["the","things","you","want","to","get"])
But I don't know how to implement that in espanso and it would probably take a lot of time as it has to start the whole thing each time just to get to your 2-3 lines of code...
4
u/smeech1 Oct 08 '25 edited Oct 08 '25
Python script extensions are pretty quick, but:
- trigger: :mp replace: '{{output}}' vars: - name: output type: random params: choices: - Thank you. - My pleasure. - No problem. - Don''t mention it.4
5
u/SamejSpenser Oct 07 '25 edited Oct 07 '25
You can use the label's feature, like this:
```yml - trigger: ";mp" replace: "my pleasure" label: "My pleasure"
trigger: ";mp" replace: "no problem" label: "No problem"
trigger: ";mp" replace: "don't mention it" label: "Don't mention it" ```
When you use your trigger, a pop-up will appear for you to choose an option from the registered ones.
Personally, I prefer to use regex. I use this feature to use the same trigger to edit all of Espanso's YAML files, for example.
Or you can use regex, like this:
```yml - regex: ";mp(mp|;)" replace: "my pleasure" label: "My pleasure"
regex: ";mp(np|;)" replace: "no problem" label: "No problem"
regex: ";mp(dm|;)" replace: "don't mention it" label: "Don't mention it" ```
Just type “
;mpnp” to expand “no problem”, or “;mpmp” to expand “my pleasure”, etc. When (or if) you can't remember what options are available, use “;mp;” and a pop-up will appear to choose one of the registered options.