 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Benjamin
Joined: 01 Mar 2007 Posts: 16
|
Posted: Tue Oct 09, 2007 10:20 am Post subject: GetClipboardData error replaced by application error? |
|
|
Hi all,
since I've updated my Autohotkey to the latest version, I no longer get the "GetClipboardData" errors (yay team!).
Unfortunately, they seem to be replaced by an application error that crashes my Autohotkey.
Moderator: Space should not exist in an URL.. I have replaced the space with %20 in http://www.uploadgeek.com/uploads456/1/autohotkey%20error.JPG
By excessive use of sleep, 25 it somewhat works again, but stil at random times the error occurs. Below you'll find the script.
Note that the clunky way of getting a simple copy / paste action is done because it copies from a screen that is opened through Citrix, and it has been my experience that a normal ^c often fails (I presume because of lag in the citrix connection?).
| Code: |
!+k::
SetTitleMatchMode, 2
WinActivate hp OpenView service desk
Sleep, 25
Send ^{home}
Inputbox, pool, Aantal calls, Hoeveel calls heb je in totaal?
Inputbox, samples, Selectie, Hoeveel calls wil je selecteren?
offset := pool//samples
emailadressen =
Run Excel
Sleep 1000
WinActivate Book1
Send $email{tab}$cusname{tab}$callnummer{tab}$regdate{tab}$description{enter}
Loop, %samples%
{
counter = 0
#WinActivateForce
#ClipboardTimeout 2000
Loop
{
WinActivate hp OpenView service desk
WinWaitActive hp OpenView service desk
Sleep, 25
Send {Ctrl Down}
Sleep, 25
send c
Sleep, 25
Send {Ctrl Up}
Sleep, 25
StringTrimLeft, clipboard, clipboard, 46
Sleep, 25
Stringsplit, linearray, clipboard, %A_Tab%
Sleep, 25
StringTrimRight, linearray4, linearray4, 6
Sleep, 25
Stringsplit, emailarray, linearray1, @
Sleep, 25
IfNotInString, emailarray1, .
{
Sleep, 25
Send {down}
Sleep, 25
counter := counter+1
}
Else
{
IfInString, emailadressen, %linearray1%
{
Sleep, 25
Send {down}
Sleep, 25
counter := counter+1
}
Else
Sleep, 25
clipboard = %linearray1%%A_Tab%%linearray2%%A_Tab%%linearray3%%A_Tab%%linearray4%%A_Tab%%linearray5%
break
}
}
emailadressen = %emailadressen% %linearray1%
Send {up %counter%}
Sleep, 25
Send {down %offset%}
Sleep, 25
WinActivate Book1
WinWaitActive Book1
sleep, 25
Send {Ctrl Down}
Send v
Send {Ctrl Up}
Send {Down 1}
}
WinActivate Book1
WinWaitActive Book1
sleep, 25
Send ^{Home}{right}{down}
Send ^+{down}
Send ^c
Sleep 25
Stringreplace, clipboard, clipboard,(ICT-Contactpersoon),,All
Sleep 25
Stringreplace, clipboard, clipboard,(ICT Contactpersoon),,All
Sleep 25
Stringreplace, clipboard, clipboard,(UID. RG`, PG),,All
Sleep 25
Stringreplace, clipboard, clipboard,(ambtelijke top),,All
Sleep 25
Send ^v
Return |
After the error occurs the clipboard appears empty, so I presume it was an GetClipboardData error that triggers the application error.. |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 403 Location: Galil, Israel
|
Posted: Sun Oct 14, 2007 12:32 pm Post subject: |
|
|
I too have a couple of still current bug reports relating to the clipboard....
and certainly it's important part of AHK, IMHO,
but... is there a reason you don't copy clipboard to var, and do the string swaps, and then return the clipboard...
(if this makes sense to you) _________________ Joyce Jamce |
|
| Back to top |
|
 |
Benjamin
Joined: 01 Mar 2007 Posts: 16
|
Posted: Thu Oct 18, 2007 8:41 am Post subject: |
|
|
| Joy2DWorld wrote: | I too have a couple of still current bug reports relating to the clipboard....
and certainly it's important part of AHK, IMHO,
but... is there a reason you don't copy clipboard to var, and do the string swaps, and then return the clipboard...
(if this makes sense to you) |
You mean something like this?
| Code: |
Send ^c
Temvar = clipboard
...... //perform actions on tempvar
clipboard = tempvar
Send ^v |
I don't do that because the error occurs when getting the data from the clipboard. The var "clipboard" will remain empty when the error occurs, so this won't make a difference because the error is in accessing the clipboard itself. (that is if I understood you correctly) |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 403 Location: Galil, Israel
|
Posted: Sun Oct 21, 2007 12:29 am Post subject: |
|
|
indeed, but doesn't that stop the crash of ahk ?
and you can loop to deal with 'blank' clipboard.
and if is blank... does errorlevel show anything? _________________ Joyce Jamce |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Fri Nov 16, 2007 4:30 am Post subject: |
|
|
To go further on analyzing this, we'd need either:
(1) Some way of reproducing the crash on any system (preferably with a simple/short script).
(2) A crash dump file and someone skilled enough to use it to isolate the bug (if there is a bug). I've tried to use crash dumps in the past with WinDbg but was never able to extract the right line number or a good stack trace. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|