Table of Contents

Using ContentObject ActivatePostion

Note that ContentObjects created in older versions did not have the properties required for this feature, and using the command will have no effect - see Updating ActivationPostion Properties for details on adding these values to an existing ContentObject.

When a ContentObject is created, two properties are set:

Property Value Property Purpose and Considerations
ActivateCaption Screen title of the window when captured Used by Activate command to detect if the window exists and to bring it to the foreground.
The stored caption may have workflow specific text that must be wildcard out!
ScreenSizeRectString Size and position of the window Repositioning the window can be a very useful technique when dealing with text fringing see - Using Image of Text as a Lookfor

The ActivatePostion method uses these two properties but also allows passing a bespoke caption to bypass the stored value. Internally it uses the ActivatePosition method - See Activate Commands for full details. The timeout allows for pausing for the passed window, the default is 0 which means logically when you call the method you are expecting that the window caption exists. If you want your automation to pause for the window first, then set the timeout appropriately.

The method will return false if the window was not found, or if the properties are not set. You can use the ContentObject's LastError to see if false was because the properties were not set or the window wasn't found.

Updating ActivationPostion Properties

Select the ContentObject in the ContentObject's list and select the Properties tab.

ActivateCaption

To edit an Activate Caption field to reflect the desired screen caption type into the field and click the Save button at the bottom.

Note that window captions (or you may call them window titles) can often have workflow specific information, Test vs Prod, a patient identifier, some specific exception text. One main use for an Activate command is to ask "Hey does this window exist?". This means you often need to pattern match using wildcards.

To help understand what you need to use for a wildcard lets use an example caption of:

Editing Patient Fred - OurEMR

You could use:

Editing Patient
Editing  [but be careful as this could be not unique enough!]
Editing Patient* [the trailing* is not manditory as the above showed but is a good practice!]
*Patient* [the trailing* is manditory!]

ScreenSizeRectString

You have to a bit of exacting prep work here.

  • First, make sure the window that has your ContentObject currently exists on your desktop!
  • Second make sure it is in the location and is the size you want it to be - be mindful of this Using Image of Text as a Lookfor
  • Third, make sure the ActivateCaption is EXACTLY what you want for this window because it has be able to Activate the window!
  • Click the link that says Update ActivatePosition

If the Activate is successful, it stored the value, and Comments will be updated with the stored value.