Get Active Window Activity

studio

#1

Hi All,
Can anyone provide an example of how to use the Get Active Window Activity as i am not sure of where to use or how to use it.


#2

Hi @pruthvisiddhartha

The activity is supposed to return the current active window, which basically means the window ‘on top’ that is visible :slight_smile:

You can use it to possibly check if the window you need is active


#3

Thanks @loginerror as always :slight_smile:


#4

Hi @loginerror

Sorry I’m just going through the academy and learn posts hoping to pick up some skills.

I get that the get active window returns the currently active window as a Window variable type. But what would you do with that returned object, what activities take a window variable as an input.

There is a Do sequence inside the get active window so how do you use it? Why do you want to run a sequence within the GetActiveWindow activity.

The docs for Get Active Window is

but I’m still not very clear what to do with it after reading that (I understand what it does I’m just not clear how that helps you, and why the contained do sequence) .

I think it would be helpful to have examples provided with the activity docs (I understand that’s a lot of work but maybe forum users could attach xamls to the documentation so that their usage can be clarified a bit.and the more examples the better rather than just one).

There must be tons of examples of code that has been generated in the forums which is quite tricky to sift through. If those examples could be organised to the docs where you would hope to find the answers to dev questions that may be of help.


#5

@charliefik

It would certainly be nice to have some examples with the docs.

As to this case, I think its pretty clear:
Retrieves the current active Window and enables you to perform multiple actions within it.

This means that the DO sequence that it comes with applies directly to the window with Windows focus. This means that if you want to target your actions directly to the window that currently has focus, you can simply use this activity and put your actions within it.


#6

So the GetActiveWindow generates a container which everything within the do works with, so you don’t have to worry about another window becoming active while you are running activities within the GetActiveWindow activity? (like attach browser)

Because it has an output which is a Window type variable what would you do with that?