Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

There was an error while copying to the Clipboard. Adobe


  • Please log in to reply
3 replies to this topic
Keith198191
  • Guests
  • Last active:
  • Joined: --
I spend most of my AHK time scripting at work to automate tasks that normally take 15 minutes and do them in 2 minutes. I love this program.

I've come up on a few issues when copying from Adobe, and unfortunately due to business restrictions I am unable to use a different PDF viewer/editor.

I have my macro clicking around in an open PDF with request data and then copying fields into variables and from there using those variables to complete this request in another system.

Adobe has an issue where if you copy from it, every now and then you'll get an error message (with the "info chatbox" icon) that says " There was an error while copying to the Clipboard. An internal error occurred. "

The thing is, what I was attempting to copy HAS copied. The problem is that the Adobe popup has occured which is interrupting my macro.






Two questions:
1. Is there a quicker/easier way to get fields from within a PDF in Adobe or with default windows programs than just opening the PDF with Adobe and clicking on the field I need til it's highlighted and hitting Control and C?

2. If not, is there a way I can have another autohotkey script or a check before each copy that this window is not open, and if it is, to close it? Perhaps a way to check within the Visible Window Text if that error message is being shown and if so close that window?




Here is the AutoIt3 Window Spy of the window. My mouse is over the "OK" button if that matters:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Adobe Reader
ahk_class #32770

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:          661, 404  (less often used)
In Active Window:           380, 125

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<
ClassNN:              Button2
Text:      OK
Color:    0xC8D0D4  (Blue=C8 Green=D0 Red=D4)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 281     top: 279     width: 462     height: 156

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
There was an error while copying to the Clipboard. An internal error occurred.
OK

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<
Cancel

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<


Keith198191
  • Guests
  • Last active:
  • Joined: --
I'm going to attempt the following after each copy action.

WinGetText, AdobeCopy, Adobe Reader, , , 
if InStr(AdobeCopy, "There was an error while copying to the Clipboard. An internal error occurred")
{
WinClose
Sleep, 200
}


Keith198191
  • Guests
  • Last active:
  • Joined: --
Didn't work. It closes the popup but then Adobe is frozen. Had to "end task" it.

Any ideas?

Keith198191
  • Guests
  • Last active:
  • Joined: --
I'm going to try throwing an AdobeProblem() after each copy request in my macro.

AdobeProblem()
{
WinGetText, AdobeCopy, Adobe Acrobat, , , 
if InStr(AdobeCopy, "There was an error while copying to the Clipboard. An internal error occurred")
{
WinWait, Adobe Acrobat, 
IfWinNotActive, Adobe Acrobat, , WinActivate, Adobe Acrobat, 
WinWaitActive, Adobe Acrobat, 
Sleep, 50
Send, {SPACE}
}
}