jkitchin / ox-clip

Copy formatted content from org-mode
67 stars 10 forks source link

Error on Windows 10 using ox-clip-formatted-copy #16

Open kings2u opened 2 years ago

kings2u commented 2 years ago

I'm on Windows 10 trying to use the ox-clip-formatted-copy command. It seems to work at first, but then I get a *Shell Command Output* buffer that says the following:

Traceback (most recent call last):
  File "c:\Users\John\.emacs.d\elpa\ox-clip-20210528.2059\html-clip-w32.py", line 227, in PutToClipboard
    win32clipboard.OpenClipboard(0)
pywintypes.error: (5, 'OpenClipboard', 'Access is denied.')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\John\.emacs.d\elpa\ox-clip-20210528.2059\html-clip-w32.py", line 268, in <module>
    PutHtml(data)
  File "c:\Users\John\.emacs.d\elpa\ox-clip-20210528.2059\html-clip-w32.py", line 42, in PutHtml
    cb.PutFragment(fragment)
  File "c:\Users\John\.emacs.d\elpa\ox-clip-20210528.2059\html-clip-w32.py", line 218, in PutFragment
    self.PutToClipboard(html, fragmentStart, fragmentEnd, selectionStart, selectionEnd, source)
  File "c:\Users\John\.emacs.d\elpa\ox-clip-20210528.2059\html-clip-w32.py", line 232, in PutToClipboard
    win32clipboard.CloseClipboard()
pywintypes.error: (1418, 'CloseClipboard', 'Thread does not have a clipboard open.')

I did some searching for the error and believe it relates to the clipboard being in use by too many programs at a small moment in time, as explained at https://stackoverflow.com/questions/60751385/python-how-to-slove-the-problem-pywintypes-error-5-openclipboard-access

Do you think that's the problem? I've reproduced the issue on multiple Windows machines. Any help would be much appreciated!

jkitchin commented 2 years ago

I don't have a Windows machine to test this on. I don't know what other programs would be using the clipboard though.

VladimirAlexiev commented 1 year ago

@kings2u Do you use a clipboard manager? See https://github.com/jkitchin/scimax/issues/282