Selecting specific button on screen

Hey there.

I'm using Salesforce, and I was wondering if there is a way to directly place the cursor on a specific button on screen and then use the {click} command to activate the button.

I would use automations, using tab, or up/down arrow, but the webpage varies in the amount of items there are between where I would place the snippet and the button itself, so the automation wouldn't work every time.

I was thinking I could use {=extractregex} in order to locate the button, but I haven't been able to pull it off, in fact, I'm not even sure if it is possible at all.

Any ideas? Thank you.

1 Like

Hi, and welcome to the forum! :slight_smile:

Theoretically if could be possible. If the page has multiple layouts you could use the {site} command + some logic to determine which layout you are in and then use the {if} command to select the appropriate number of {key: tab} or other autopilot commands.

It's going to be fairly complex though and could also be brittle (e.g. if Salesforce changes their layouts).

Could you tell us more about what you are trying to do? Maybe there is an alternative solution.

Thank you! Yes, if it's possible it'd be really complicated.

So to be more specific about what I'm trying to do...

In the center of Salesforce I have a customer chat, which is where I'd apply the snippet.

What I want the snippet to do is click on the Resolved button, which closes the case.

The thing is that between the text box and that button, there are links sometimes, and sometimes not. So it is pretty much impossible to pull it off using just tab commands.

Hi @Juan_Murillo,

If the number of tabs required varies, I doubt there's a reliable method to do this.

That said, I would personally avoid using a snippet to complete the submission of a form. If it's just a click, I think it's always safest to complete the procedure manually in case of mistakes. But that's just my recommendation

I actually found the way to do it, but turns out it is simply faster to just click it manually, since it's takes less time than the amount of tabs that it is requires. Not worth it. Thanks a lot for the help!

1 Like

I've been tinkering with a way to accomplish something similar, and encounter the same obstacles regarding Salesforce (Lightning) and inconsistencies of button placement. The solution I have had most success with involves the first command of the snippet being a hotkey combination already built in to Salesforce which brings my cursor to the same matter where I am on the screen. In this example, the Salesforce hotkeys for "Go to publisher" are "Ctrl+Alt+g, then p". This brings the focus to a fixed point in the record every time. From there, a number of Autopilot commands can be run. My snippet looks like this:

{key:ctrl-alt-g}{wait: delay=.1s}{key:p}{wait: delay=.2s}{key:rightarrow}{wait: delay=.5s}{key:rightarrow}{wait: delay=.5s}{key:rightarrow}{wait: delay=.5s}{repeat: 8}{key:tab}{wait: delay=.3s}{endrepeat}{key:ctrl-a}{key:backspace}{repeat: 3}{key:tab}{wait: delay=.3s}{endrepeat}{key:enter}{key:downarrow}{key:enter}{wait: delay=.5s}{repeat: 3}{key:tab}{wait: delay=.3s}{endrepeat}{click}{wait: delay=.5s}{key:s}{key:a}{key:v}{key:e}{key:d}{wait: delay=.3s}{key:tab}{wait: delay=.3s}{key:tab}{wait: delay=.1s}{key:enter}{click}{wait}{repeat: 4}{key:tab}{wait: delay=.1s}{endrepeat}{wait: delay=.1s}{click}{wait: delay=3s}{key:ctrl-alt-g}{wait: delay=.1s}{key:s}{repeat: 20}{key:tab}{endrepeat}{key:c}{wait: delay=.3s}{key:c}{key:enter}{repeat: 3}{key:tab}{endrepeat}(DP - Access) 21-Day MIA Review{repeat: 7}{key:tab}{endrepeat}.

Hope this helps spark some ideas!


Cool stuff @Brad_Hedinger! Love how you're combining both platforms to squeeze the most out of them.

Would love to get on a call sometime to see your workflow in action, if you could spare 15mins.

1 Like

If there is any specific selector for the links or items that are hindering your automated snippets, you could use the site selectors to check the presence of that links or items.

Then you can program the automated snippets for each case.

I have this one that I use in Salesforce as example

{note}Here you can place the selector in question

{TO={site: text; selector= [class="windowViewMode-maximized active lafPageHost"]; multiple=yes}}

{note} And here you can filter the results, it can be with the contents inside the list your extracted or it can be by length as in case 4

{if: includes(TO, "Value1")}{case_type=2}{elseif: includes(TO, "Value2")}{case_type=3}{elseif: includes(TO, "Value3")}{case_type=1}{elseif: count(TO) == 2}{case_type=4}{else}{=error("New Case Type")}{case_type=5}{endif}


Hope it helps :slightly_smiling_face:

1 Like

Great thinking @Diego_Suancha!

So if I understand correctly, you're checking for the preseence of certain selectors, and then defining an action based on their presence (possibly by varying the number of repetitions for the tab keypress).

Am I right?

@Cedric_Debono_Blaze You are right, I use it in two ways, checking the occurrence of a string inside a selector generated list, or checking the length of that list. (I think that it can be used in many more ways)

In this case is useful for the case that Juan presented on top with the automation snippets. In my particular case I use it to detect different type of cases inside CF1 and tailor my snippet according to that.

1 Like

@Diego_Suancha - great, and thanks again for sharing this cool snippet. I've been using Text Blaze since 2018 and I've done A TON with it, but I still keep seeing new approaches and strategies from other users and I keep learning new tricks.

Have you experimented with regex in Text Blaze yet? It's a lot of fun.

Here's a thread to get you started if you're interested:


Absolutely @Cedric_Debono_Blaze! I’m available most weekdays as early as 8am EST. Slack? Zoom? Your pick!

@Brad_Hedinger, thanks. Let's take this to email so we can sort out a time.

Please email me on with subject line: "ATTN: CEDRIC".

1 Like