0

I'm making an autohotkey script to populate several fields in a PDF form.

The script begins to take a number in a excel sheet, opens a site in an intranet, pass some values to variables, then closes the intranet page and opens the PDF form (4 pages).

Here I need to fill some PDF fields, but I don't know how to reach them.

I use the "ImageSearch" but must change the image file any time I change the computer (home, desktop, notebook...)

Is there a way to reach the field by name, propertys, tags...?

Sending variables to the fields, the script truncates the variable's contents. For example, the variable is "Jose antonio marques rodrigues". In the field only gets "Jose antonio marques". Somebody can explain why does this happen?

I use Acrobat Reader or Acrobat DC. It happens with both of them.

  • Have you tried using TAB to reach to the specific fields? – Sonamor Aug 1 at 16:21
  • Yes I did and it works when I'm already in the document. But how to reach the first field I want? – Manuel Batoca Aug 4 at 14:40
0

With Adobe Reader not running, after opening the document, the first time you send a TAB, it should take you to the first field on the form. In the case below I was able to send 8 TABS to get to the eighth field and then send the data

; download the following to your machine
; https://www.txdmv.gov/reports-and-data/doc_download/998-form-130-u-application-for-texas-title-and-or-registration
; change the following folder path accordingly 
SetTitleMatchMode, 2 
Run D:\ChromeDownloads\130-U.pdf    ;this assumes you have Adobe as the program for .pdf files
WinWaitActive Adobe Acrobat Reader DC
SendInput {Tab 8}
SendInput this should be the OTHER field
Return

For the record I am on Windows 10 running Adobe Acrobat Reader DC Continuous Release | Version 2019.012.20035

  • Thank you so much, Kevin McCabe. It helped me to find the goal. Now I can reach the field I want. Additionally, to fill it without lose any part of the variables I use "SetBatchLines, 30 ms" and a sleep 100 between each line sendinput and each tab, like this: SetBatchLines, 30 ms / SendInput {Tab 4} / Sleep 100 / SendInput %Nif% / Sleep 100 / SendInput {Tab 10} / Sleep 100 / SendInput %Nome% / Sleep 100 / Thus, all the contents of the variables is sent and recieved in the fields. Thank you, again – Manuel Batoca Aug 6 at 22:46
  • Glad to help! In 4 years of active AHK programming, I've never come across the need to use SetBatchLines. Your explicit Sleep commands are probably doing the job on their own. Please Accept the answer if it is correct. – Kevin McCabe Aug 8 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.