@dereklim78: These allow you to inspect the clipboard contents, that might give you some clues.
Free Clipboard Viewer for Windows
http://www.freeclipboardviewer.com/
InsideClipboard - View the content of all formats stored in the Clipboard
https://www.nirsoft.net/utils/inside_clipboard.html
WinClip - AHKv2 Compatibility
Re: WinClip - AHKv2 Compatibility
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: WinClip - AHKv2 Compatibility
strange, sounds like its working if it works in MSWORD, but maybe some win10 change is blocking your medical appdereklim78 wrote: ↑03 Nov 2019, 22:12All this worked in Win7, but there in Win10 there seems to be a glitch now - it does copy into the clipboard, but when I Ctrl-V into the client program (an electronic medical record), it doesn't paste anything, whereas Ctrl-V in Ms-Word works fine.
did you try the setRTF modification to the script mentioned above:
https://www.autohotkey.com/boards/viewtopic.php?p=281949#p281949
?
-
- Posts: 150
- Joined: 28 Sep 2016, 11:14
- Contact:
Re: WinClip - AHKv2 Compatibility
As mentioned on this thread, WinClip does not paste the html clipboard properly when it has special characters (e.g., a Spanish word such as añadió)
The change below fixed it, but wondering if there's a reason for how it is at the moment?
Original WinClip.ahk:
Tweaked function:
The change below fixed it, but wondering if there's a reason for how it is at the moment?
Original WinClip.ahk:
Code: Select all
GetHtml()
{
if !( clipSize := this._fromclipboard( clipData ) )
return ""
if !( out_size := this._getFormatData( out_data, clipData, clipSize, "HTML Format" ) )
return ""
return strget( &out_data, out_size, "CP0" )
}
Tweaked function:
Code: Select all
GetHtml(enc:="UTF-8")
{
if !( clipSize := this._fromclipboard( clipData ) )
return ""
if !( out_size := this._getFormatData( out_data, clipData, clipSize, "HTML Format" ) )
return ""
return strget( &out_data, out_size, enc )
}
-
- Posts: 25
- Joined: 18 Apr 2019, 06:24
Re: WinClip - AHKv2 Compatibility
GetHtml() and iGetHtml() seem to mangle non-ASCII characters. Changing the output from CP0 to UTF-8 seems to fix it.
Re: WinClip - AHKv2 Compatibility
Has anyone been able to update this to a more recent version of v2? I'm dying to use it, but moving it forward is a bit beyond me.
I started attempting to upgrade the code, but I got stumped by how to upgrade things like ObjSetCapacity, ObjGetAdress, and VarSetCapacity for V2, particularly when they are applied to properties of objects...
I'm now working on moving my own code back to v1 so I can use this library. Which is a shame because I love v2.
I started attempting to upgrade the code, but I got stumped by how to upgrade things like ObjSetCapacity, ObjGetAdress, and VarSetCapacity for V2, particularly when they are applied to properties of objects...
Code: Select all
_setClipData( ByRef data, size )
{
if !size
return 0
if !ObjSetCapacity( this, "allData", size )
return 0
if !( pData := ObjGetAddress( this, "allData" ) )
return 0
WinClipAPI.memcopy( pData, &data, size )
return size
}
_getClipData( ByRef data )
{
if !( clipSize := ObjGetCapacity( this, "allData" ) )
return 0
if !( pData := ObjGetAddress( this, "allData" ) )
return 0
VarSetCapacity( data, clipSize, 0 )
WinClipAPI.memcopy( &data, pData, clipSize )
return clipSize
}
Re: WinClip - AHKv2 Compatibility
I've always had a problem with the WinClip library that is that WinClip.iSetHTML does not work (as I would expect). Anyone using it successfully or having the same issue?
Re: WinClip - AHKv2 Compatibility
I'm learning this great class, however I experienced an error with the code below - Continuable Exception Access Violation.
- Copy some random text to the Clipboard - it must be a formatted text, for example copy it from Word,
- Run Ctrl+X to paste the example text using the old ahk method and the image using WinClip.
It seems WinClip doesn't work if the content of the clipboard is formatted text from ClipboardAll.
Can anyone confirm this? What am I doing wrong please? Thanks!
- Copy some random text to the Clipboard - it must be a formatted text, for example copy it from Word,
- Run Ctrl+X to paste the example text using the old ahk method and the image using WinClip.
It seems WinClip doesn't work if the content of the clipboard is formatted text from ClipboardAll.
Can anyone confirm this? What am I doing wrong please? Thanks!
Code: Select all
#include, WinClipAPIMod.ahk
#include, WinClipMod.ahk
^x::
clipbak:=ClipboardAll
clipboard:=""
clipboard:="Test Clipboard Content"
clipwait, 2, 1
sleep 250
Send, ^{vk56} ;~ send ^v
sleep, 100
clipboard:=""
clipboard:=clipbak
clipwait, 2, 1
WinClip.Snap( data )
clipboard :=""
WinClip.Clear()
WinClip.SetBitmap("D:\Test\Image.png") ;change to your image
sleep, 20
WinClip.Paste()
WinClip.Restore( data )
return
Re: WinClip - AHKv2 Compatibility
What version of AHK are you using?
Re: WinClip - AHKv2 Compatibility
EDIT: I'm done converting it automatically (it's different)
WinClipAPI.ah2
WinClip.ah2
@JoeSchmoe
same, I wanted to use v2
so I converted to AHK_H v2: https://github.com/FuPeiJiang/WinClipv2
only tested on WinClip.SetHTML() & WinClip.GetHtml() (because I only needed these)
if it doesn't work, submit a github issue (or PR if you can see how I converted it?)
but I really want to convert automatically (so I'm working on a v1 parser)
WinClipAPI.ah2
WinClip.ah2
@JoeSchmoe
same, I wanted to use v2
so I converted to AHK_H v2: https://github.com/FuPeiJiang/WinClipv2
only tested on WinClip.SetHTML() & WinClip.GetHtml() (because I only needed these)
if it doesn't work, submit a github issue (or PR if you can see how I converted it?)
but I really want to convert automatically (so I'm working on a v1 parser)
Re: WinClip - AHKv2 Compatibility
@m3user
I've downloaded AutoHotkey_1.1.30.03 from https://autohotkey.com/download/1.1/
and ran "Downloads\AutoHotkey_1.1.30.03\AutoHotkeyU64.exe" "test35.ahk"
I've tested and also done ExitApp and haven't gotten "Continuable Exception Access Violation"
1) you should download latest version: https://autohotkey.com/download/
does "Continuable Exception Access Violation" still happen ?
this happens for me when using AHK_H v2
whenever a class is extended for ex: class WinClip extends WinClip_base
and when I ExitApp, this error will be thrown
2) what is inside ?:
#include, WinClipAPIMod.ahk
#include, WinClipMod.ahk
(test paste and image paste are working correctly)
so I isolated the issue (idk if it's with WinClip or with ahk.exe itself(clipboard) ):
READ THE COMMENTS
I've downloaded AutoHotkey_1.1.30.03 from https://autohotkey.com/download/1.1/
and ran "Downloads\AutoHotkey_1.1.30.03\AutoHotkeyU64.exe" "test35.ahk"
I've tested and also done ExitApp and haven't gotten "Continuable Exception Access Violation"
1) you should download latest version: https://autohotkey.com/download/
does "Continuable Exception Access Violation" still happen ?
this happens for me when using AHK_H v2
whenever a class is extended for ex: class WinClip extends WinClip_base
and when I ExitApp, this error will be thrown
2) what is inside ?:
#include, WinClipAPIMod.ahk
#include, WinClipMod.ahk
(test paste and image paste are working correctly)
so I isolated the issue (idk if it's with WinClip or with ahk.exe itself(clipboard) ):
READ THE COMMENTS
Code: Select all
; clipboard:=ClipboardAll ;this doesn't cause the error ;I guess this is coded(in ahk.exe) to do nothing at all
clipBak:=ClipboardAll ;saving ClipboardAll to a variable then .Snap transforms it into weird characters
clipboard:=clipBak
WinClip.Snap( data )
WinClip.Restore( data )
send, ^v
Re: WinClip - AHKv2 Compatibility
Very impressive!MrDoge wrote: ↑19 May 2021, 08:19EDIT: I'm done converting it automatically (it's different)
WinClipAPI.ah2
WinClip.ah2
I'm afraid that your technical skills are way above mine. Will this work with AHK2 (not AHK_H)? If so, do you recommend a version of AHK2? I use v2.0-a122.
I am very glad you are working on this. We need an updated v2 version of WinClip.
Last edited by JoeSchmoe on 24 May 2021, 22:15, edited 1 time in total.
Re: WinClip - AHKv2 Compatibility
I’m actually using AHK_H (not 2). Never thought this would be the reason, should report it on a H forum.
Re: WinClip - AHKv2 Compatibility
I asked a question here but moved it to the "Ask for help" section.
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: WinClip - AHKv2 Compatibility
Trying to move to v2 and I also have the issue to get WinClip library compatible to v2. Currently it won't even run with WinClip.
I had to replace Exception with Error, replace ByRef with &.
My last problem is the line:
The variable 'intialized' appears to never be assigned a value
I had to replace Exception with Error, replace ByRef with &.
My last problem is the line:
Code: Select all
class WinClipAPI_base extends WinClip_base
{
__Get( name ) {
if !this.HasOwnProp(initialized)
this.Init()
else
throw Error( "Unknown field '" name "' requested from object '" this.__Class "'", -1 )
}
}
Re: WinClip - AHKv2 Compatibility
Update: this post shall be moved maybe or renamed.
See viewtopic.php?f=83&t=91054&p=402344&hilit=winclip#p402344
See viewtopic.php?f=83&t=91054&p=402344&hilit=winclip#p402344
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: submeg and 94 guests