← Back to team overview

sikuli-driver team mailing list archive

[Question #315005]: shutil.move(pic, sfile) returns error in 1.1.1

 

New question #315005 on Sikuli:
https://answers.launchpad.net/sikuli/+question/315005

This script works in SikuliX 1.1.0.  I get a screenshot named
"OSX10.11.5 2016-08-01 15.11.10 Empty checkbox not found left of Reduce Transparency"

In 1.1.1 I get this error which seems to not like the parms in shutil.move(pic,sfile) where the
script reads as below.  Not sure what changed here???
############################## Script ###########################
def snapit(msg):
    bounds = getBounds()
    pic = Screen(0).capture(bounds)
    print("snapshot taken, + msg")
    msg = msg.rstrip("\n")
    sfile = path + "OSX10.11.5 " + time.strftime("%Y-%m-%d %H.%M.%S ") + msg + ".png"
    shutil.move(pic,sfile)
############################### LOG #############################
[log] ( ⌘+⌥ ) TYPE "h"

[log] App.open [2990:System Preferences]

2016-08-01 15\:15\:01, Dragged System Preferences Window to top

[log] CLICK on L(1738,448)@S(0)[0,0 1920x1080] (581 msec)
2016-08-01 15\:15\:02, Clicked on Accessibility

2016-08-01 15\:15\:06, Empty checkbox not found left of Reduce Transparency

snapshot taken, + msg
[error] script [ mac10-11-onboard ] stopped with error in line 536
[error] TypeError ( coercing to Unicode: need string, org.sikuli.script.ScreenImage type found )
[error] --- Traceback --- error source first
line: module ( function ) statement 
293: shutil ( move ) File "/Users/joe/SikuliX-1.1.1/SikuliX.app/Contents/Java/sikulix.jar/Lib/shutil.py", line 293, in move
22: main ( snapit ) shutil.move(pic,sfile)
172: main ( clickitdir ) snapit(msg)
318: main ( reducetrans ) rc = clickitdir(reducet,desc,"left",echkbox,desc2,75)
[error] --- Traceback --- end --------------

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.