Forum Discussion

fbordalo's avatar
fbordalo
Occasional Contributor
6 years ago
Solved

Python scripting - way to Initialize IDispatchwrapper shell object

Is there a way to initialize a shell IDispatchwrapper object inside a python script? Can I extend the class (no real need)? .

 

Code snippet:

def func(string):

  shell_idispatcherwapper = <class>

  If not isinstance(string, str):

    return shell_idispatcherwapper

 

  getAllChildren = Aliases.browser.page.tree.FindAllChildren('ObjectType','ListItem',2,True)

  <more code>

  shell_idispatcherwapper= getAllChildren 

  return shell_idispatcherwapper

 

def callFunction()

  obj = function(someObject)

  if not obj.Exists:

    Log.Error("We failed")