Author Topic: Can VA create a drop down list of text options?  (Read 969 times)

librarian

  • Newbie
  • *
  • Posts: 15
Can VA create a drop down list of text options?
« on: November 10, 2022, 03:27:58 PM »
For years I have been using a program called QuickTextPaste to paste frequently used text while cataloguing. I wonder if VA could be used to replace it. I had a bit of a look and couldn't find any functions that would help, nor forum topics about this.

What I envision is a command makes a list of text options appear (10, 20, 30 options), then another commands selects the one I want to paste and pastes it where the cursor is. Is there functionality already included that could do this?

I know how I could program it to paste specific text based on commands but being able to display the options is the missing piece. Display is needed as some of the text is not used frequently enough to remember and there are hundreds of options. I have ~20 different lists that have anywhere between 5 and ~30 options to choose from.

Thanks


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Can VA create a drop down list of text options?
« Reply #1 on: November 10, 2022, 04:40:15 PM »
The "Get User Input - Choice" action can display a dropdown list of options, which can be populated using a variable or token.

Probably not the ideal type of list for this, but if you want a ListView or something similar, you'd need to write a plugin or inline function to display and manage a WPF or WinForms window, with the appropriate control(s).

librarian

  • Newbie
  • *
  • Posts: 15
Re: Can VA create a drop down list of text options?
« Reply #2 on: November 17, 2022, 02:13:17 PM »
Thanks, that isn't too bad. It would be ideal if I could see the whole list and select a numbered option, but this is workable.

librarian

  • Newbie
  • *
  • Posts: 15
Re: Can VA create a drop down list of text options?
« Reply #3 on: November 17, 2022, 02:46:09 PM »
I am having one issue with this. The get choice window always opens on the screen the VA window is on, which for me is not my main screen. Can I make the get choice window open near the mouse cursor or at least on the active screen?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Can VA create a drop down list of text options?
« Reply #4 on: November 17, 2022, 02:56:44 PM »
On my machine the window does open centered on the screen the mouse cursor is on


You can move the window explicitly, using the "Perform a Window Function" action, however as the "Get User Input - Choice" action is synchronous (I.E. the command waits for the window to be closed before further actions are executed), you'll need to do that in another command.

E.G.
Code: [Select]
Execute command, 'Move choice window'
Get Choice Input [~]

Move choice window
Code: [Select]
Move window 'My Choice Window' to (0,0) (pause up to 2 Seconds for availability)

Obviously you'd want to set the "Window Title" option for the "Perform a Window Function" action to the actual title you entered into the corresponding field of the "Get User Input - Choice" action.