← Back to team overview

sikuli-driver team mailing list archive

[Question #231118]: [1.0] problems importing .sikuli scripts in the same directory

 

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

hello, 

i am trying to import one  .sikuli file into another so that i can reuse some code. both files are in the same folder. 

this is what i tried first:

from sikuli import *
from java.awt import Toolkit
from java.awt.datatransfer import DataFlavor
from org.sikuli.script.natives import Vision
import os
#get the directory containing your running .sikuli
myPath = os.path.dirname(getBundlePath()) #line 9
if not myPath in sys.path: sys.path.append(myPath) # line 10
import oxpToolKit
App.focus('*new 1 - Notepad++')
type('a', KeyModifier.CTRL)
type('c', KeyModifier.CTRL)
print oxpToolKit.getClipboardText()

and this is the error message i got:

Exception in thread "Thread-12" java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Unknown Source)
at org.sikuli.ide.SikuliIDE$ButtonRun.findErrorSourceWalkTrace(Unknown Source)
at org.sikuli.ide.SikuliIDE$ButtonRun.findErrorSource(Unknown Source)
at org.sikuli.ide.SikuliIDE$ButtonRun.access$1500(Unknown Source)
at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(Unknown Source)

[error] script [ scratch ] stopped with error in line 11
[error] ImportError ( No module named oxpToolKit )

i also tried it with lines 9 and 10 commented out and i got the same error code. im on windows 8

thanks in advance for any help you can give me

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.