How to If there is text in the place I specified, copy text else don't do anything?

Hi I want to this

If there is text in the place I specified, copy text else don't do anything

How can I do ?

1 Like



You can use get text activity to get that particular text. Then use get text output and

You can use get text output with string contains.

If > gettextoutput.contains(“your text”)

If string contains, you can use copy to clipboard activity to copy. Otherwise you can leave.


1 Like

Use get text Activity and then use if condition
If GetText.Tostring.Contains(“Your Text”)
Then copy text

1 Like

There is no specific text. I want to if there is text in there, copy text.

We got two options to do this
—First is use GET TEXT activity and specify a element and get the text as a output in string variable
Now pass that string variable as input to SET TO CLIPBOARD activity so that it will be sent to clipboard
Then we can paste that with SEND HOT KEY activity with key as ctrl+v


We can use GET ATTRIBUTE activity and get the value of text attribute or aaname attribute and get the output with a variable of type string
then remaining same setting to clipboard with SET TO CLIPBOARD activity

Or just if we want to set a text to clipboard
We can mention that string as input to SET TO CLIPBOARD activity

Cheers @sufyant

1 Like

then just do
if gettext output
i.e. GetText.tostring.trim=“” or String.IsEmptyOrNull(GetText)
then nothing
u can use this variable for as you say set to clipboard

1 Like

But I want to assign it to a ‘variable’ and then use it after. And I can’t do that

1 Like

then we can directly save the text to a string variable instead of using SET TO CLIPBOARD activity. i.e., we can get the output from GET TEXT or GET ATTRIBUTE activity and store them in a string variable

or if you have copied to clipboard already and if we want to be stored in a string variable then we can use GET FROM CLIPBOARD activity and get the string from clipboard to a string variable which can used anywhere

Cheers @sufyant

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.