[英]How to load binary content to clipboard without anything removed or manipulated? (Autohotkey)
I have binary content stored in a file (containing previous clipboard content) is being modified (without purpose or adding code for this) every time I try to load it to clipboard. 我每次尝试将其加载到剪贴板时,都会修改存储在文件中的二进制内容(包含以前的剪贴板内容)(无目的或为此添加代码)。
The binary content represents organised paragraphs on OneNote copied to clipboard. 二进制内容表示复制到剪贴板的OneNote上的有组织段落。 In order to be able to use later, I saved the clipboard binary contents to test.clip file using: 为了能够以后使用,我使用以下命令将剪贴板二进制内容保存到test.clip文件:
FileAppend, %ClipboardAll%, C:\My\Path\test.clip
Then when I try to retrieve the binary file test.clip contents to clipboard using: 然后,当我尝试使用以下命令检索二进制文件test.clip内容到剪贴板:
FileRead, Clipboard, *c C:\My\Path\test.clip
And paste to OneNote, I get incomplete paragraphs from the ones that was copied before and saved to the binary file. 并粘贴到OneNote,我从之前复制并保存到二进制文件的段落中得到不完整的段落。
I tried to check the difference between the old binary file test.clip
and the clipboard content after loading this file. 我试着在加载这个文件后检查旧的二进制文件test.clip
和剪贴板内容之间的区别。 I saved the new clipboard content to test2.clip after retrieving test.clip to check if there's something manipulated or not using: 我在检索test.clip之后将新的剪贴板内容保存到test2.clip,以检查是否存在操作或未使用的内容:
FileRead, Clipboard, *c C:\My\Path\test.clip
FileAppend, %ClipboardAll%, C:\My\Path\test2.clip
I compared the two files test.clip and test2.clip (Which are expected to be the same). 我比较了两个文件test.clip和test2.clip (预计它们是相同的)。 I found that there's a block of binary code (at the end of the file) was removed after each load for test.clip to clipboard (The removed block is marked red in the below image): 我发现每次加载test.clip到剪贴板后都会删除一块二进制代码(在文件的末尾)(删除的块在下图中标记为红色):
How could I fix this to load the binary clipboard content stored in test.clip without getting anything removed or manipulated from the actual file content? 我怎么能解决这个问题,加载存储在test.clip中的二进制剪贴板内容,而不从实际文件内容中删除或操作任何内容?
Don't use %ClipboardAll%
here. 这里不要使用%ClipboardAll%
。 Just use %clipboard%
. 只需使用%clipboard%
。
" Clipboard is a built-in variable that reflects the current contents of the Windows clipboard if those contents can be expressed as text. “ 剪贴板是一个内置变量,它反映了Windows剪贴板的当前内容,如果这些内容可以表示为文本。
By contrast , ClipboardAll contains everything on the clipboard, such as pictures and formatting ." 相比之下 , ClipboardAll 包含剪贴板上的所有内容,例如图片和格式 。“
- https://autohotkey.com/docs/misc/Clipboard.htm - https://autohotkey.com/docs/misc/Clipboard.htm
Quoting from the docs again, I think i see your problem: " If ClipboardAll cannot retrieve one or more of the data objects (formats) on the clipboard , they will be omitted but all the remaining objects will be stored. " 再次从文档中引用,我认为我看到了你的问题:“ 如果ClipboardAll无法在剪贴板上检索一个或多个数据对象 (格式) , 它们将被省略, 但所有剩余的对象都将被存储。 ”
As an example: 举个例子:
F4::
FileAppend, %Clipboard%, clipboardcontents.clip
FileRead, Clipboard, clipboardcontents.clip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.