Jump to content

Recommended Posts

Hello,

still learning and trying to understand AutoIT but having problem in filling my PDF file.

 

So my code looks like similar to this:

Global $1 = "text text 44444444"
Global $2 = "texting2 texting2"
Global $3 = "newtext3 next3"


ShellExecute ("C:\Users\XXX\Desktop\myPDF.pdf")
WinWaitActive("MyPDF.pdf - Adobe Acrobat Reader DC")
Send ("{TAB}")
ClipPut($1)
Send ("^v")
Send ("{TAB 3}")
ClipPut($2)
Send("^v")
Send ("{TAB}")
ClipPut($3)
Send("^v")

So its fill my PDF form, the first field looks good, the code add the text text 4444, then second should be $2 with texting2 texting2 but for some reason the code uses for second and third field after TAB only variable $3.

So, I receive in $2 and $3 for some reason same newtext3 next3 in both, why its skipping the variable $2? Maybe there also much better solution for instant text? Because Send writes with delay by letters which I don't like.

Thanks!

Link to post
Share on other sites
8 minutes ago, Danp2 said:

Also, have you considered dropping the use of ClipPut and just send the variable contents?

I do not have Acrobat Reader installed, but the approach from @Danp2 seems plausible to me.

Global $1 = "text text 44444444"
Global $2 = "texting2 texting2"
Global $3 = "newtext3 next3"

ShellExecute ("C:\Users\XXX\Desktop\myPDF.pdf")
WinWaitActive("MyPDF.pdf - Adobe Acrobat Reader DC")
Send ("{TAB}")
Send ($1)
Send ("{TAB 3}")
Send ($2)
Send ("{TAB}")
Send ($3)

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to post
Share on other sites
6 hours ago, Danp2 said:

I've seen where you need a delay following ClipPut to give the item time to "appear" on the clipboard. Also, have you considered dropping the use of ClipPut and just send the variable contents?

You mean with Send()?

If yes, then it takes time while Send writes all the text and Opt SendKeyDownDelay, SendKeyDelay doesn't work here with 0 or 1 delay.

Link to post
Share on other sites
44 minutes ago, diff said:

Opt SendKeyDownDelay, SendKeyDelay doesn't work here with 0 or 1 delay.

The value sets the time in milliseconds to pause (default=5)(0 removes the delay completely). It is not an on/off switch. Try to set the value to 50 or 100. For testing purposes you can also place Sleep(xxx) commands between the sends. Not the most elegant solution, but give it a try.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to post
Share on other sites
24 minutes ago, Musashi said:

The value sets the time in milliseconds to pause (default=5)(0 removes the delay completely). It is not an on/off switch. Try to set the value to 50 or 100. For testing purposes you can also place Sleep(xxx) commands between the sends. Not the most elegant solution, but give it a try.

Yeah I understand that it's not on/off, I tried random ms to set but it was still writing too long.

Looks like ClipPut works better if I add delay at least Sleep(200) about which was talking @Danp2. So, probably I solved my problem by adding everywhere Sleep(200) after ClipPut()

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mLipok
      ; #INDEX# =======================================================================================================================
      ; Title .........: UDF for "Debenu Quick PDF Library"
      ; AutoIt Version : 3.3.10.2++
      ; Language ......: English
      ; Description ...: A collection of functions for Debenu Quick PDF Library
      ; Author(s) .....: mLipok
      ; Modified ......:
      ; ===============================================================================================================================
      Release note:
       
       
      Erratum v0.7:
       
      Forum link:
       
       
    • By mLipok
      I would like to present, the UDF for Debenu Quick PDF Library
      Getting Started:
      http://www.debenu.com/products/development/debenu-pdf-library/getting-started/getting-started-activex-edition/
      Function Reference:
      http://www.debenu.com/docs/pdf_library_reference/FunctionGroups.php
      Useful information:
      http://www.quickpdf.org/forum/quickpdf-the-first-steps_topic1242.html
      http://www.quickpdflibrary.com/blog/2011/02/the-basics-getting-familiar-with-quick-pdf-library/
      First time installing Debenu Quick PDF Library:
      You can download demo here:
      http://www.quickpdflibrary.com/downloads/quick_pdf_library_demo.exe
      Requirements:
      file "DebenuPDFLibraryLite1012.dll" or "DebenuPDFLibraryAX1014.dll" must be in @ScriptDir

      if you want to try you must download it from here:
      http://www.debenu.com/products/development/debenu-pdf-library/trial/
      or
      http://www.debenu.com/products/development/debenu-pdf-library-lite/free/
      after install you can find this dll in:
      "c:\Program Files (x86)\DebenuPDF Library\ActiveX\DebenuPDFLibraryAX1014.dll"
      or
      "c:\Program Files (x86)\DebenuPDF Library\Lite\DebenuPDFLibraryLite1012.dll"

      !!! you can change DLL to newer version using _QPDF_NewLibraryPath_Commercial()

      EDIT: actualy (19-06-2015) there is DebenuPDFLibraryAX1115.dll and DebenuPDFLibraryLite1115.dll
        to use the commercial version you need to use the _QPdf_SetLicenseKey() AutoIt 3.3.10.2++ For UDF and examples download, and the current version information please go to download section:

       
      The following information are outdated
    • By mLipok
      This is a UDF for use Debenu PDF Viewer SDK - ActiveX component.
      You can read more about this ActiveX component here:
      http://www.debenu.com/products/development/debenu-pdf-viewer-sdk/
       
      v 0.2
       
      2015/05/18   v0.3
       
    • By seadoggie01
      This UDF is because I'm tired of trying to use UI Automation and Send to automate Adobe Acrobat. I often need to read the contents of PDFs and Acrobat is not easy to work with as a window.  The functions are based on the API Reference from Adobe located here.
      Acrobat Pro is required for all functions.
      It's very beta right now, but it still seems to work. Currently, the functions are based around page level manipulation of PDF documents: re-arranging, swapping, deleting, and moving pages as this is what I use the most.
      Please feel free to request/suggest features!
       
       
    • By Danyfirex
      AT Command UDF - for control AT Modems, send SMS, get SMS
       
      Changelog:
      #cs 1.0.0 2020/10/03 . First version - Danyfirex + mLipok 1.0.1 2020/10/04 . Added - Function - _ATCmd_IsPINReady - Danyfirex . Added - Function - _ATCmd_IsPINRequired - Danyfirex . Added - Function - _ATCmd_IsSIMInserted - Danyfirex . Added - Function - _ATCmd_IsSenderSupported - Danyfirex . Added - Function - _ATCmd_OnPINReques - Danyfirex . Added - Function - _ATCmd_SMS_ListTextMessages - Danyfirex . Added - Function - _ATCmd_SetPIN - Danyfirex . Added - Function - __ATCmd_GetPINCounter - Danyfirex - Added - ENUM - $ATCmd_ERR_PIN - Danyfirex - Added - ENUM - $ATCmd_ERR_SIM - Danyfirex . Changed - __ATCmd_ComposePDU() - using _ATCmd_UseUCS2() internally instead parameter - Danyfirex . Suplemented - #CURRENT# - Danyfirex . . 1.0.2 2020/10/05 . Added - ENUM - $ATCmd_MSGLIST_* - mLipok . Added - ENUM - $ATCmd_STATUS__* - mLipok - Added - ENUM - $ATCmd_ERR_PARAMETER - mLipok . Added - _ATCmd_UsePDU() - parameter validation - mLipok . Added - _ATCmd_UseUCS2() - parameter validation - mLipok . Added - more error logs . Changed - MagicNumber replaced with Standard UDF constants - mLipok . Small refactoring - mLipok . . 1.0.3 2020/10/05 . CleanUp - Danyfirex . . 1.0.4 2020/10/05 . Small refactoring - Danyfirex . CleanUp - Danyfirex . . 1.0.5 2020/10/23 . _ATCmd_FullLoging - mLipok . _ATCmd_CMEESetup() ... @WIP - mLipok . $ATCMD_STATUS_11_SUBSCRIBERNUMBER - mLipok . . 1.0.6 2020/10/25 . __ATCmd_CMSErrorParser() - mLipok . . @LAST https://www.nowsms.com/gsm-modem-cms-error-code-list https://m2msupport.net/m2msupport/at-command-to-enable-error-codes/ https://www.micromedia-int.com/en/gsm-2/73-gsm/669-cme-error-gsm-equipment-related-errors https://assets.nagios.com/downloads/nagiosxi/docs/ATCommandReference.pdf https://www.maritex.com.pl/product/attachment/40451/15b4db6d1a10eada42700f7293353776 https://www.multitech.net/developer/wp-content/uploads/2010/10/S000463C.pdf https://www.telit.com/wp-content/uploads/2017/09/Telit_AT_Commands_Reference_Guide_r24_B.pdf https://docs.rs-online.com/5931/0900766b80bec52c.pdf PDU Format / Testers / Encoders / decoders https://m2msupport.net/m2msupport/sms-at-commands/#pduformat http://smstools3.kekekasvi.com/topic.php?id=288 #ce  
       
      Saludos
×
×
  • Create New...