← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #180122]: Env.getClipboard is not updated

 

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

Robert Feldt proposed the following answer:
A workaround on Mac that I sometimes found helpful is to use the
following code to save (or append with fileFlag 'a') the Mac's clipboard
contents to a file:

def save_mac_clipboard_to_file(filename, fileFlag = 'w'):
    if fileFlag == 'w':
        os.system('pbpaste > ' + filename)
    elif fileFlag == 'a':
        os.system('pbpaste >> ' + filename)

Especially if one was planning to save the contents to file anyway; with
this code you need not go "through" Sikuli and get the associated
Env.getClipboard problems. However, one can fully work around the bug by
first using the above code to save to a (temporary) file and then read
that files contents into a string in Sikuli...

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