this question is connected to this WinClip thread/lib: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=29314
This is weired: If I store the clipboard data retrieved with WinClip.Snap(clipData) into an associative (or simple) array, then when I want to restore it, the clipboard is empty afterwards. If I use a normal variable to store the retrieved data (instead of the array), the clipboard gets restored as expected.
Here is some sample code. (To test, please download the library from the linked thread.) To compare, make sure that before each try there is some text on the clipboard. Try the code and then toggle the commenting out (";~") of the last two lines, copy some text onto the clipboard again, and try the code again.
Code: Select all
#Include WinClipAPI.ahk
#Include WinClip.ahk
arr := Object()
WinClip.Snap(clipData)
arr.clipOrg := clipData
clipRestore := arr.clipOrg
;~ WinClip.Restore(clipRestore)
WinClip.Restore(clipData)