For debugging Debugging Scripts scripts, several things are helpful:
Settings.UserLogs = True Settings.UserLogTime = True Debug.user("Start of READ_DOC script") Debug.user(getBundlePath())
This will print the following in the message section:
[sikuliLog (1/11/15 1:11:14 PM)] Start of READ_DOC script [sikuliLog (1/11/15 1:11:14 PM)] /Users/sunflower23/SikuliX/read_doc.sikuli/
When taking examples, such as this, print "string"
should be replaced by Debug.user("string")
myApp = App("Safari") myApp.focus() myApp.focusedWindow().highlight(2)
For this to work, the following option must be selected so Sikuli can take control:
Check "Enable access for assistant devices" in the System Preferences and then close this dialog.
Bordens-iMac% ls -dl ./SikuliX-IDE.app/Contents/runIDE ./scan_desktop_impact.sikuli -rwxr-xr-x 1 sunflower23 staff 1148 Dec 11 21:14 ./SikuliX-IDE.app/Contents/runIDE drwxr-xr-x 4 sunflower23 staff 136 Jan 26 22:01 ./scan_desktop_impact.sikuli Bordens-iMac% ./SikuliX-IDE.app/Contents/runIDE -r ./scan_desktop_impact.sikuli running SikuliX-IDE: -Xmx512M -Dapple.laf.useScreenMenuBar -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine -jar ./SikuliX-IDE.app/Contents/sikuli-ide.jar -r ./scan_desktop_impact.sikuli [user (1/27/15 9:03:51 PM)] Start of scan_desktop script.
One interesting discovery about the IDE - Each time a script is saved, the png files in that directory that are not listed in the script are cleaned out!