I often use a program which refuses to send the highlighted text to the clipboard. There is a "Send to Clipboard" option, but it doesn't do anything – or I don't have the rights. I'm able to highlight text, so I should be able to send to the clipboard
Is there any way to bypass this limitation/restriction and manually send the highlighted text on screen to the clipboard (i.e. other than using Send, ^c)? Of course I'd be using #IfWinActive to target the specific program.
Thanks kindly.
How to force a program to send highlighted text to the clipboard
- Consolarificus
- Posts: 19
- Joined: 10 Feb 2016, 09:00
Re: How to force a program to send highlighted text to the clipboard
You could have another try using ControlGetText. You very last resort > OCR
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: How to force a program to send highlighted text to the clipboard
If the program window is actively trying to prevent you from coping and pasting then it is probably going to be very difficult to copy and paste.
A secured PDF for example will allow you to highlight text but not copy it to the clipboard.
You can use the Window Spy tool that comes with AHK. If when you select the window with the tool if it does not display the text in the "Text" field of the tool then ControlGetText will not work.
FG
A secured PDF for example will allow you to highlight text but not copy it to the clipboard.
You can use the Window Spy tool that comes with AHK. If when you select the window with the tool if it does not display the text in the "Text" field of the tool then ControlGetText will not work.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
- Consolarificus
- Posts: 19
- Joined: 10 Feb 2016, 09:00
Re: How to force a program to send highlighted text to the clipboard
I know you were half kidding there, but I actually attempted this using an OCR script posted here, and the hotkey returned the text I had previously copied... It completely ignored my copying attempts of the selected text in the troublesome program.BoBo wrote:You very last resort > OCR
Gonna throw the towel and keep on re-typing manually
Re: How to force a program to send highlighted text to the clipboard
Locked/secured PDFs are quite easy to unlock using Ghostscript (free, open source) - just google "unlock pdf ghostscript" and you'll find various solutions. Personally I've never had it fail, but apparently there are some documents that will resist this method. Free software FTWFanaticGuru wrote:A secured PDF for example will allow you to highlight text but not copy it to the clipboard.
Re: How to force a program to send highlighted text to the clipboard
"unlock pdf google chrome" will provide some details as well.
Re: How to force a program to send highlighted text to the clipboard
Sometimes this works, I wish people would mention it more often. I.e. try AccViewer, and if it can get text, you can get the text via the Acc library.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
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
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: How to force a program to send highlighted text to the clipboard
For the record, I just downloaded Ghostscript and googled a command line series of options to basically recreate a copy of a PDF without the password.Guest wrote:Locked/secured PDFs are quite easy to unlock using Ghostscript (free, open source) - just google "unlock pdf ghostscript" and you'll find various solutions. Personally I've never had it fail, but apparently there are some documents that will resist this method. Free software FTWFanaticGuru wrote:A secured PDF for example will allow you to highlight text but not copy it to the clipboard.
It worked well on the one simple secured PDF I tried. It is important to realize that it is not removing the password on a PDF. It is creating a new PDF that is a pretty good clone of the original by basically printing it to a new PDF. The file size is changing significantly so something is changing (probably resolutions) so I would have to evaluate it carefully on important complex documents but looks very suitable for just creating a document that I can copy and paste from to save some typing.
An AHK script that makes the file selecting easer and automatic new naming of clone without having to play with a command line in the Command Prompt would be nice.
All-in-all, pretty nifty. I don't often need to break the security on PDFs but the batch modifying and converting that Ghostsript offers could be useful. Especially with some AHK script to help the process.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
- Consolarificus
- Posts: 19
- Joined: 10 Feb 2016, 09:00
Re: How to force a program to send highlighted text to the clipboard
Thanks for mentioning it. Unfortunately, no luck with this either.jeeswg wrote:Sometimes this works, I wish people would mention it more often. I.e. try AccViewer, and if it can get text, you can get the text via the Acc library.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Who is online
Users browsing this forum: Araphen, CrowexBR, Google [Bot], mcd, rubeusmalfoy, ShatterCoder, spellegrnio1 and 85 guests