Select from a Drop Down

Hello! Is there a way to have Textblaze search a drop down list of brand names and select a specific one? For instance, we have a list of a few dozen different brand names and instead of having to scroll through and select the brand name I'm looking for in each instance, I'd like to be able to type a snippet for said brand name and have it automatically select that brand name from the drop down for me instead of me having to scroll through to find it.

I tried using the downarrow a set number of times for each brand, but the list never starting in the same place. For example sometimes the brand dropdown in black so I could just downarrow 3 times to get to Brand C, but sometimes the brand dropdown already has Brand B selected so I would just need to downarrow once to change it to Brand C. So it's not consistent enough to use downarrows based off of the position of the Brand in the list.

I also tried using the home button to reset the list each time so it would be consistent, but I could find a way to make Textblaze recognize the Home keypress.

I guess my question is, is there a way for Textblaze to just read all the brands in the list and select the one that matches the snippet I typed? Or are there other solutions that would make this more efficient or even possible?

Thank you!

Hi @cwight, welcome back to the forum. :slight_smile:

Can you please try the following approach?

I guess your brand name is known in advance, now rather than using the arrow keys, try to type the brand value with a chain of {key} commands, after you get the dropdown menu activated, as follows:

{brand="MyBrand"}{wait: delay=+1s}{repeat: for x in split(brand, "")}{key: {=x}}{endrepeat}

Please let me know if that works for you.

This isn't really working and maybe there are a number of reasons for that. But for one, the drop down list doesn't really take typing into it all that well. And if the typing is too slow or it delays to much it will select that brand and refresh the page. Do you have another other idea to make this work? A lot of the brands are also duplicates of each other for different pack sizes, etc and when it does work it just selects the first one in the list rather than the one it actually belongs too.

Ok I think it might actually work if I got get the drop down list to actually open. When it's open, you can move between brands without it selecting/refreshing the site, but when it's closed it just selects the first think that 'matches' which is never right. I tried using the click element for it to open, tried using a keypress for space bar and enter, and I tried alt-downarrow and none of those would actually open the dropdown list...so maybe this just won't work. I'm kind of stuck on what else I could try.

@cwight Most probably you cannot use the autopliot commands to open the dropdown menu, please check this post for more details.

Did you give my snippet a try? You can activate the dropdown first, rather than opening it, using a sequence of the {key: tab} commands (like clicking on some input in your page with the {click} command, then pressing as many tabs as it needs to activate your dropdown menu, using a sequence of the {key: tab} command). Ater that, use the code of the snippet I shared to type the brand name, I hope this selects your brand. Even if typing slowly manually will refresh the page, please give it a try with the autopilot, it will type it quickly without getting the page to refresh. Here's an example:

{brand="Your brand name"}
{wait: delay=+1s}
{click: frame=top; selector=#your-input-selector; maxdelay=+1s}{key: tab}{wait: delay=+1s}
{repeat: for x in split(brand, "")}{key: {=x}}{endrepeat}

If the page just refreshed on the first key press, then I'm afraid there can be no way to automate this selection. Please let me know if the snippet I shared did the trick for you, or if you need any further assistance applying that approach.