title: Checking if an application is already open with Sikuli
body: <p>I'm creating a script in Sikuli for automated testing but have come across what seems a basic issue that I cannot seem to find a workaround for.</p>
  
  <p>The problem I have is that I am trying to use 2 different apps for the script I am working on. To be exact, if the applications are already open, the program fails to focus on them and tries to run onto the next couple of lines</p>
  
  <p>I have read through the limited documentation Sikuli has online and seen many other's similar issues but I cannot apply any of that to fix this issue.</p>
  
  <p>Code:</p>
  
  <pre><code>appone = App("C:\Program Files (x86)\appone.exe")
  apptwo = App("C:\Program Files (x86)\apptwo.exe")
  
  if(appone.isRunning(3)):
      appone.focus()
  else:
      appone.open()
  
  if(apptwo.isRunning(3)):
      #do nothing#
  else:
      apptwo.open()
  
  wait(5)
  
  click("image.png")
  </code></pre>
  
  <p>I have tried using image recognition to check the window's taskbar to see if the app is running but that throws out other errors as well.</p>
  
  <p>Appone is the main application running which I am using Sikuli for, and apptwo is a helper application that needs to be running for appone to do what I need it to do.</p>
  
  <p>What is the best way to solve this issue?</p>
  
  <p>EDIT: I found a great solution that I tweaked to fit my situation from the answer of this thread: <a href="https://stackoverflow.com/questions/28559997/check-if-window-is-already-exist-then-make-the-window-as-active-else-open">Check if Window is already exist , then make the window as active else open</a></p>