Forum Discussion

cbahn001's avatar
cbahn001
Occasional Contributor
9 years ago
Solved

Is it possible to place a variable within an object path and use the Set Variable Value to define?

I have an action to click on a particular button named the following   Aliases["LocationManager"]["HwndSource_Window"]["WindowLocationManagerQa20151Version116115C"]["PrismShellWindowContent"]["Cont...
  • Marsha_R's avatar
    9 years ago

    We did something similar, but we built a string out of the known part of the object (Aliases["LocationManager"] etc.) and added the variable to the end, then changed that to the object with eval

     

    for example (with your alias string shortened):

     

    set a string variable

    MyCropString = "TextblockCorn"

     

    set an object variable

    MyObjectString = eval("Aliases["LocationManager"]" + Project.Variables.MyCropString)