Why won't Applications launch in Windows Vista?

Asked by frizzlefrazzle

I have read the similar question at https://answers.launchpad.net/sikuli/+question/99153 and followed the advice to no avail.

I copied the full path, C:\Program Files\IObit\IObit Security 360\is360.exe, to the application from the "Object name:" on the Security tab of the is360 Properties and entered it in Sikuli like this, switchApp(C:\Program Files\IObit\IObit Security 360\is360.exe).

I then received this error message:

[sikuli] [Error] Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('C:\\Users\\USERNAME_CONCEALED\\AppData\\Local\\Temp\\sikuli-tmp3672657245308541208.py', 1, 12, 'switchApp(C:\\Program Files\\IObit\\IObit Security 360\\is360.exe)'))

I even changed the lower case "i" to upper case like this, switchApp(C:\Program Files\IObit\IObit Security 360\Is360.exe) and that didn't work either.

This particular app is just one of several I have tried to get to launch and nothing works. Where is my mistake?

All help is greatly appreciated.

Thanks.

FrizzleFrazzled

P.S. Some video demos of Windows automation would be very nice.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
frizzlefrazzle
Solved:
Last query:
Last reply:
Revision history for this message
kerridge0 (klearurnychpad) said :
#1

Hi

you need to include quotes around the app name

switchApp("C:\Program Files\IObit\IObit Security 360\is360.exe")

Revision history for this message
frizzlefrazzle (southerndethcult) said :
#2

Wow! That was a ridiculous mistake on my part. Thank you for pointing that out. I know better than that from the video demo. However, in my own defense, I copy and pasted "switchApp(app)" from http://sikuli.org/documentation.shtml#doc/pythondoc-python.edu.mit.csail.uid.Sikuli.html and then pasted the path over "app" in parentheses.

Adding quotes did solve the syntax error, but, the app still doesn't open. I also tried to open Firefox by using switchApp("C:\Program Files\Mozilla Firefox\firefox.exe"), no luck.

When I click on the Play button in Sikuli to test that one line, Sikuli just blinks and no app opens from the closed state nor is the app brought to the front when already open in the background.

Further assistance is appreciated, as always.

Revision history for this message
JDegoler (jason25883) said :
#3

You need to capitalize any letters immediately after backslahes as suggested in Question #99153

switchApp("C:\Program Files\Mozilla Firefox\Firefox.exe")

Revision history for this message
JDegoler (jason25883) said :
#4
Revision history for this message
frizzlefrazzle (southerndethcult) said :
#5

You are correct sir!

Okay. I'm getting somewhere now.

Sikuli clearly has the potential to become the WYSIWYG editor for non-programmers. It would be great to see an online school like w3schools.com and a Tidy function like that for HTML.

Any tips on how to run scheduled Sikuli functions? I would like my project to run automatically at a scheduled time without me having to initiate it.

Thanks again for the help. Eventually I will post my finished project for educational purposes, if I get it working the way I want.

Revision history for this message
Sergey Darovskih (darovskih) said :
#6

Are you familiar with BAT files? If you will download command line Sikuli tool, you will be able to run your scripts using batch files. Or by any scheduler.

Revision history for this message
frizzlefrazzle (southerndethcult) said :
#7

No I am not familiar with BAT files. I just learned about Sikuli about a day and a half to two days ago. I don't know anything about programming either. I learned HTML, XHTML & CSS at w3schools.com and from Sitepoint books. By time I started to try to get into JavaScript my interest and need was waning.

I am very interested in using Sikuli to aggregate and publish information for a web site which just wouldn't possible for me to do myself, to the extent that I want, because of the amount of time involved.

I am open to suggestions and links.

Thanks

Revision history for this message
frizzlefrazzle (southerndethcult) said :
#8

I just spent a significant amount of time creating a test script to get Sikuli to open Firefox, open Bookmarks, visit sites and select options from drop down menus. I saved the script as "test" and tried to run it. It did not work and it was not saved.

I started over with only the switchApp(app) script to open Firefox, which did work, but the script would not save. Now I'm getting frustrated. How hard is it to click on "save as" and save as "test"?

I lost a 10 step script which was to be a template for other work. Before I re-write the script I need to know why the scripts are not saving. Any ideas?

Thanks for the help and patients.

Revision history for this message
nicholas percy (nicholas-percy) said :
#9

I have tried the above on both these paths on my Vista Machine
C:\Windows\System32\Notepad.exe
C:\Program Files\Mozilla Firefox\Firefox.exe
 but nothing happens just a flash
This is what I'm using
switchApp("C:\Program Files\Mozilla Firefox\Firefox.exe")
switchApp("C:\\Program Files\\Mozilla Firefox\\Firefox.exe")
AND
switchApp("C:\Windows\System32\Notepad.exe")

If these application are already open should it reopen another instance ?

Thanks Nick

Revision history for this message
nicholas percy (nicholas-percy) said :
#10

Note using Java 6.0.6001 on 32bit vista machine

Revision history for this message
nicholas percy (nicholas-percy) said :
#11

Thsi all the errors I can see:
[sikuli] Stopped
[sikuli] An error occurs at line 1
[sikuli] Error message:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Sikuli\sikuli-script.jar\Lib\sikuli\Sikuli.py", line 18, in <module>
java.lang.NoClassDefFoundError: Could not initialize class edu.mit.csail.uid.Finder

 at java.lang.Class.forName0(Native Method)

 at java.lang.Class.forName(Unknown Source)

 at org.python.core.SyspathJavaLoader.loadClass(SyspathJavaLoader.java:107)

 at java.lang.ClassLoader.loadClass(Unknown Source)

 at org.python.core.Py.findClassEx(Py.java:817)

 at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)

 at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)

 at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)

 at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)

 at org.python.core.PyObject.__findattr__(PyObject.java:869)

 at org.python.core.imp.import_name(imp.java:771)

 at org.python.core.imp.importName(imp.java:806)

 at org.python.core.ImportFunction.__call__(__builtin__.java:1232)

 at org.python.core.PyObject.__call__(PyObject.java:367)

 at org.python.core.__builtin__.__import__(__builtin__.java:1202)

 at org.python.core.imp.importFromAs(imp.java:884)

 at org.python.core.imp.importFrom(imp.java:860)

 at sikuli.Sikuli$py.f$0(C:\Program Files\Sikuli\sikuli-script.jar\Lib\sikuli\Sikuli.py:166)

 at sikuli.Sikuli$py.call_function(C:\Program Files\Sikuli\sikuli-script.jar\Lib\sikuli\Sikuli.py)

 at org.python.core.PyTableCode.call(PyTableCode.java:165)

 at org.python.core.PyCode.call(PyCode.java:18)

 at org.python.core.imp.createFromCode(imp.java:326)

 at org.python.core.util.importer.importer_load_module(importer.java:109)

 at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)

 at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)

 at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)

 at org.python.core.imp.loadFromLoader(imp.java:451)

 at org.python.core.imp.find_module(imp.java:408)

 at org.python.core.PyModule.impAttr(PyModule.java:109)

 at org.python.core.imp.import_next(imp.java:637)

 at org.python.core.imp.import_logic(imp.java:699)

 at org.python.core.imp.import_name(imp.java:761)

 at org.python.core.imp.importName(imp.java:806)

 at org.python.core.ImportFunction.__call__(__builtin__.java:1232)

 at org.python.core.PyObject.__call__(PyObject.java:367)

 at org.python.core.__builtin__.__import__(__builtin__.java:1202)

 at org.python.core.__builtin__.__import__(__builtin__.java:1185)

 at org.python.core.imp.importAll(imp.java:904)

 at org.python.pycode._pyx26.f$0(<string>:1)

 at org.python.pycode._pyx26.call_function(<string>)

 at org.python.core.PyTableCode.call(PyTableCode.java:165)

 at org.python.core.PyCode.call(PyCode.java:18)

 at org.python.core.Py.runCode(Py.java:1204)

 at org.python.core.Py.exec(Py.java:1248)

 at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)

 at edu.mit.csail.uid.ScriptRunner.runPython(ScriptRunner.java:52)

 at edu.mit.csail.uid.SikuliIDE$ButtonRun.runPython(SikuliIDE.java:1190)

 at edu.mit.csail.uid.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:1288)

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class edu.mit.csail.uid.Finder

Does Sikuli not work with latest Java?

Revision history for this message
nicholas percy (nicholas-percy) said :
#12

Sorted:
Had to remove Sikuli and java
Then install latest Java 6.0.6001
Reboot machine
Reinstall Sikuli
Works now

Might be able to get away with the Java Update then Sikuli and no reboot.
But happy now as working so can get on and evaluate.