Stuck. How to validate current Windows Setting, then change it

Another person helped me figure out the selector issue (windows changes the “name” of the setting whenever a new program is set as a default, like email), but I’m stuck on how to validate the name before attempting to change the default setting. I’m guessing I would scrape the current name, then do an IF statement, then change if True, but how would I go about that?

I’m very new to UiPath, so sorry for some major basic questions, but I’m not even sure how to get the reference out of the selector to use as part of an IF statement.

Thanks in advance!

appid=‘windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersiv>econtrolpanel’ title=‘Settings’ />
automationid=‘SystemSettings_DefaultApps_EmailDefaultAssociation_TitleTextBlock’ >cls=‘TextBlock’ name=‘Google Chrome’ />

Hi Kath,

You can use Get Text activity to scrape the element you desire. Just make sure you use wildcard such as “*” in case the name changes.

In your example:
appid=‘windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersiv>econtrolpanel’ title=‘Settings’ />
automationid=‘SystemSettings_DefaultApps_EmailDefaultAssociation_TitleTextBlock’ >cls=‘TextBlock’ name=‘*’ />

This will try to get the text of the element whatever its name.

Thank you! I’ll try that. I think I was overthinking that I had to dig into the windows code more. :slight_smile: