WinClip revived for AHK v2.
=================================================================================
Credits:
Initial AHK v2 rewrite
@egocarib: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=29314
additional contributions
@autocart: https://www.autohotkey.com/boards/viewtopic.php?p=281664#p281664
Original
Deo: https://autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
=================================================================================
The example works fine. I could use some help with tests of the finer aspects though.
I only did a direct translation and basic trouble shooting. I'm still wrapping my head around all the clipboard functions / tricky bits.
Download on Github
WinClip v2 - 2023/07/22 - v2.0.4
WinClip v2 - 2023/07/22 - v2.0.4
Last edited by TheArkive on 22 Jul 2023, 11:45, edited 2 times in total.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: WinClip v2 - 2021/06/21 - a137
I finally got around to updating to the newest version of AHK2 (it really didn't take so long), and I finally tried this out.
It works perfectly. And so useful... You are the man!
It works perfectly. And so useful... You are the man!
Re: WinClip v2 - 2021/06/21 - a137
Very cool man! Thanks for the feedback!
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: WinClip v2 - 2021/06/21 - beta.1
Thanks again for converting this!
I've noticed that it can have difficulties extracting HTML source from copied text that involves certain emojis.
For example, try copying the heading, "High Voltage Sign Emoji ," from the following page: https://symbl.cc/en/26A1/
Then run the following code:
Where the actual emoji should be, I see âš¡. However, when I paste directly from the clipboard, I get the real emoji, as illustrated above.
Any thoughts?
I've noticed that it can have difficulties extracting HTML source from copied text that involves certain emojis.
For example, try copying the heading, "High Voltage Sign Emoji ," from the following page: https://symbl.cc/en/26A1/
Then run the following code:
Code: Select all
#Include lib/winclip/WinClipAPI.ahk
#Include lib/winclip/WinClip.ahk
wc := WinClip()
MsgBox wc.GetHTML()
Any thoughts?
Re: WinClip v2 - 2021/06/21 - beta.1
@JoeSchmoe, did you save your script in UTF-8 with BOM encoding, as you should?
Edit: I guess, in AHK v2, UTF-8 should suffice - you wouldn't necessarily need the BOM.
Edit: I guess, in AHK v2, UTF-8 should suffice - you wouldn't necessarily need the BOM.
Re: WinClip v2 - 2021/06/21 - beta.1
I am. It's currently UTF-8 with BOM.
(For anyone with similar issues I learned that you can check the encoding in both Scite4AutoHotkey and Notepad++. It was smart to think of encoding issues because the emoji displays as if it were rendered in a less sophisticated encoding, with multiple characters instead of one.)
Re: WinClip v2 - 2021/06/21 - beta.1
Thanks to Nikola from Discord, who found the following solution: Try to replace all the "CP0" with "UTF-8" in your WinClip library. It worked!
Re: WinClip v2 - 2021/06/21 - beta.1
@JoeSchmoe
Thanks. Done.
Thanks. Done.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: WinClip v2 - 2021/06/21 - beta.1
I'm attempting to use the SetFiles method, but I'm running into all sorts of errors. I confirmed that I can use the library, as the included examples will run just fine.
My code is about as simple as can be:
[Mod edit: [code][/code] tags added.]
My end goal is to copy that text document to the clipboard - same as if you were to select it in the file explorer and press CTRL+C.
Attached are screenshots of the errors I'm seeing. Any ideas if I'm just doing something wrong?
My code is about as simple as can be:
Code: Select all
#Requires Autohotkey v2.0+
#SingleInstance Force
#Include WinClip.ahk
#Include WinClipAPI.ahk
wc := WinClip()
wc.SetFiles("C:\Desktop\new.txt")
My end goal is to copy that text document to the clipboard - same as if you were to select it in the file explorer and press CTRL+C.
Attached are screenshots of the errors I'm seeing. Any ideas if I'm just doing something wrong?
- Attachments
-
- Screenshot 7-21-2023 - 000.png (105.95 KiB) Viewed 2470 times
Re: WinClip v2 - 2021/06/21 - beta.1
Ok, I'll look into this and see if I can figure out what's going on.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: WinClip v2 - 2021/06/21 - beta.1
@tbfaulk
I pushed a fix. I tested it on multiple files and directories. It seems to work well.
Thank for the report. Let me know if you find anything else.
I pushed a fix. I tested it on multiple files and directories. It seems to work well.
Thank for the report. Let me know if you find anything else.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: WinClip v2 - 2023/07/22 - v2.0.4
Just wanted to say THANKS @TheArkive for sharing
Return to “Scripts and Functions (v2)”
Who is online
Users browsing this forum: No registered users and 22 guests