Jump to content
spoo

How to pass a variable from sikuli to autoIT

Recommended Posts

spoo

Hi All,

since Sikuli works great with citrix application i invoked sikuli code from my autoIT script.

now can  anyone help me how do i fetch the variable that i am using in sikuli on my autoIT script

Here is the piece  of code from autoIT that invokes sikuli 

If $supplierBlank==True Then
   $fPath ="D:\Publish" ;@ScriptDir
   ClipPut(" ")
    If FileExists($fPath & "\test.bat") Then
      FileDelete($fPath & "\test.bat")
   EndIf
  FileWrite($fPath & "\test.bat","E:" & @CRLF & "java -jar " & $fPath & "\trail_sikuli.jar --args " & $part_nos_suppliers  & "," & $username_citrix  & "," & $Decrypted_Pwd)
    RunWait($fPath & "\test.bat")
     $supplierName = ClipGet()
   ;ConsoleWrite($supplierName)
   $supplierName = StringStripWS($supplierName,7)
   ;ConsoleWrite($supplierName & @CRLF)
 _IEFormElementSetValue($supplier,$supplierName)
EndIf

 

Here is the code from sikuli

import sys.argv
#part_nos_suppliers="315W1311-15,315W1311-11"
part_nos_suppliers=sys.argv[2]

username=sys.argv[3]

password=sys.argv[4]

words=part_nos_suppliers.split(",")
suppliers=""
if exists("1528364750583.png"):
 for current_words in words:
    Debug.log("part no"+part_nos_suppliers)
    mouseMove(Pattern("1528365140139.png").targetOffset(190,-4))
    mouseDown(Button.LEFT)
    mouseMove(Pattern("1528364892470.png").targetOffset(236,4))
    mouseUp(Button.LEFT)
    type("c",KEY_CTRL)
    suppliers=suppliers + "," +current_words + ":" +Env.getClipboard()
    Debug.log(str(suppliers))

 

Please help me fetch variable "suppliers" that is on sikuli  to AutoIT

 

Share this post


Link to post
Share on other sites
JLogan3o13

Better asked on a sikuli forum, but does the sikuli script have a method for writing to STDOut? You can then capture that on the AutoIt script.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
spoo

Thanks  JLogan3013. I Figured it out:)

 

suppliers=suppliers + "," +current_words + ":" +Env.getClipboard()
    Debug.log(str(suppliers))
    my_file=file(pathname+"/suppliers.txt", "w")
    my_file.write(str(suppliers))
    my_file.close

 

i copied the information into a file and i'm reading that file from AutoIT.

Happy learning !

Share this post


Link to post
Share on other sites
JLogan3o13

Glad you got it working. Again, though, if sikuli supports a standard output model, you can skip the middle man and read it directly; would increase the efficiency of your script.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×