Forum Discussion

Lagencie's avatar
Lagencie
Frequent Contributor
7 years ago
Solved

Passing a panel as parameter to a script

Hello,

 

i am using python as my programming language and I wanted to ask if it is possible to pass a panel to the function.

 

What I want to do is:

 

create a function, that takes a panel as parameter and returns the classname of this panel.

 

best regards and thanks for help upfront

  • Hi,

     

    Below might help you ,

    def getClassName(panelObject):
         return panelObject.JavaClassName you can specify what field you want to return
    
          
    def testFunctoin():
          Log.Message(getClassName(Sys.Process("jp2launcher").SwingObject("MainWindow", "*", -1, 1)))

2 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    Below might help you ,

    def getClassName(panelObject):
         return panelObject.JavaClassName you can specify what field you want to return
    
          
    def testFunctoin():
          Log.Message(getClassName(Sys.Process("jp2launcher").SwingObject("MainWindow", "*", -1, 1)))