PDF copying text/page number question

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mnutz
Posts: 2
Joined: 23 Apr 2018, 19:07

PDF copying text/page number question

23 Apr 2018, 19:19

Hi,

Wife works with large PDF's and constantly has to either copy and paste from a pdf to a word doc or has to manually type them out. All she needs is the title and the page it appears on, this is part of showing insurance T&C's in a cover letter.

I was hoping it would be easier for her to select the title, hit a key combo, AHK grabs that selected text and the page it's on and either concatenates it to a text doc without switching active program or saves it to memory until the user hits paste/ctrl+v.

Anyone know of a script that does this or any that would allow me to write something to do this?

I could attempt it in Python but AHK seems far more suited to doing this.

Thanks
TinyDancer

Re: PDF copying text/page number question

24 Apr 2018, 03:26

Easiest way is for her to run script below (no need for com), highlight what she needs and hit Q
Esc key exits the script
It will write what she highlighted and page number to a txt file in the directory of the script, or if you want change it
should save her time

Code: Select all

q::
send, ^c
ClipWait
ControlGetText, readerp, Edit2, A
; msgbox, Page Title %clipboard% Page Number %readerp%  ;if you want to test 
FileAppend,Page Title %clipboard% Page Number %readerp%`n, adobeproj.txt
return
esc::ExitApp
mnutz
Posts: 2
Joined: 23 Apr 2018, 19:07

Re: PDF copying text/page number question

24 Apr 2018, 05:06

Excellent, thanks, I'll give this a try later this evening and see if it'll work for her!
Rafaeloneil
Posts: 2
Joined: 26 Jul 2018, 12:38

Re: PDF copying text/page number question

31 Jul 2018, 13:44

Staff, taking advantage of this post I ask your help if it is possible
I'm trying to make a code that searches and finds a word in a pdf and in the sequence copies a text just below the localized word:
searchPDF.png
searchPDF.png (7.53 KiB) Viewed 864 times
Here's the code I'm trying to make work:

LarguraTela := 1280
AlturaTela := 1024

PixelSearch, X, Y, 0, 0, %LarguraTela%, %AlturaTela%, 0xD8C199, 0, fast
if ErrorLevel
{
Msgbox Not Find
}
else
{
newX := X + 50
newY := Y + 50
MouseClick, left, %newX%, %newY%
}


Can you guide me?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Mannaia666 and 401 guests