Question #262328 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/262328

    Status: Answered => Open

Dmitriy Chumachenko is still having a problem:
Hello again. I made some revisions based on what you have said and
realized that I wasn't giving Sikuli the visual feedback it needs to
proceed as coded. I made some adjustments that I thought would benefit
and double check what is happening whether I'm referencing images or not
(in the case of the Key.RIGHT and LEFT movement).  In the middle of the
code, Sikuli simply crashes without warnings or error codes. Is the
coding too redundant?


def a():
##OPEN SOFTWARE, FIND CORRECT CHANNEL
    
    if not exists (t):                         #Starting point, or reference 
for movement
        click (t)
    for x in range (6):
        type (Key.RIGHT) 
    if not exists (t2,3):                    #t2=image reference point, 
confirming that Key. RIGHT did what it was supposed to
        click (t)
        for x in range (6):
            type (Key.RIGHT)             #Repeat if not found t2  (CAN YOU DO 
THIS?)
    if not exists (t2,3):                   #If not found a second time, quit, 
print
        print ("Could not resolve Movement") 

##OPEN SYNTH        
    type (Key.F4)
    if not exists(u,3):                      #If synth doesn't appear, click F4 
again.
        type (Key. F4)
    if not exists(u,3):
        print ("Could not resolve Synth")
        exit ()                                      #Quit if doesn't find 
second time
    click(wait(u, 4))
    
#THIS IS WHERE SIKULI CRASHES WITH NO WARNING, NO PRINTS AND NO ERROR CODES - 
JUST CRASHES

##SAVE OPERATION
    if not exists(b,4):                        #If save window doesn't appear, 
try again to click on synth save button
        click (u,4)
    if not exists (b,4):                            #Quit, print on second try
        print ("Could not resolve Opening synth")
    keyDown(Key.CMD)                      #Folder Invoke
    keyDown(Key.SHIFT)
    type ("g")
    keyUp(Key.SHIFT)
    keyUp(Key.CMD)
    if not exists(a,4):
        keyDown(Key.CMD)                  #Folder Invoke again if doesn't work 
the first time
        keyDown(Key.SHIFT)
        type ("g")
        keyUp(Key.SHIFT)
        keyUp(Key.CMD)
    if not exists(a,4):
        print ("Could not resolve Folder Point")
        exit ()                                            #Quit, print if 
doesn't resolve Folder Point second time

    ##FOLDER POINT
    type ("/Beast Phoenix 01/03-Melodics/01-Albino/Ear Candy") 
    wait(.5)
    
    if not exists (a1,4):                       #Type folder location again if 
image containing written out folder location was not found
        type ("/Beast Phoenix 01/03-Melodics/01-Albino/Ear Candy") 
        wait(.5)
    if not exists(a1,4):
        print ("Could not resolve Folder Name")
        exit()                                           #Quit, print if not 
found second time

    ##NOMENCLATURE    
    type (Key.ENTER)                       #Folder type out
    wait(.5)
    type ("0000-01-Ear Candy Intro") 
    wait(.5)
    if not exists(b2,4):                     #Re-type if came out wrong
        doubleClick (b2)
        type (Key.DELETE)
        type ("0000-01-Ear Candy Intro")
    if not exists(b2,4):                      #Print, quit if doesn't find 
second time
        print ("Could not resolve Nomenclature")
        exit()
    type (Key.ENTER) #File Name Save
    wait(.5)

#FILE REPLACEMENT PROTOCOL
    if exists(h,4):
        click(wait(h, 4))                        #If prompted to replace file, 
do it
    type (Key.F4) #Close
    if not exists(t2,4): #If synth hadn't closed, do so now
        type (Key.F4)
    if not exists(t2,4):
        print ("Could not resolve Closing Synth")
        exit()

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to