PJThys
Members-
Posts
13 -
Joined
-
Last visited
PJThys's Achievements
Seeker (1/7)
0
Reputation
-
PJThys reacted to a post in a topic:
super easy noob question *pls* help
-
PJThys reacted to a post in a topic:
super easy noob question *pls* help
-
PJThys reacted to a post in a topic:
Forum behaviour
-
PJThys reacted to a post in a topic:
Forum Roll Back
-
How to detect end of copy to Clipboard
PJThys replied to PJThys's topic in AutoIt General Help and Support
'flyingboz' , you set me on the right track! I gave up watching cursorchange, too tricky. Clipboard size was not the problem, throwing in 2 times a 10 seconds wait would solve the problem. But waiting 20 seconds for a situation which only seems to happen in 20% of the cases is a shame. So I worked on your SALT idea, bij testing ClipGet() for the occurrence of a word I was sure would be in the clipboard. This seems to have solved the problem. My code is now like this: (where "comment" is a word I know exists multiple times in the copied text) Send("^a^c") ;copy all to clipboard While Not StringInStr(ClipGet(), "comment ") ;wait till "comment " is found in clipboard ;(assuming that all text is copied to clipboard then) Sleep(10) WEnd Allthough this word occurs a lot in the clipboard, StringInStr(Clipget(),"comment") does not seem to start before the clipboard is written. Can anyone confirm that behavior? I've tested it 20 times now and found no more 'timing errors' Peter -
How to detect end of copy to Clipboard
PJThys replied to PJThys's topic in AutoIt General Help and Support
No, no more exams at my age (54), We are develloping exams! As far as I know there is no accessibility functionality -
Safe method to trap mousecursor_id
PJThys replied to PJThys's topic in AutoIt General Help and Support
I move the mouse to the same position all the time (so actually it does not move!) because without a mousemove no cursorid is reported. I'm suspecting that my gui which uses messageloop could be the culprid, so I'm rewriting it to use on-event mode. If that doesn't help I'll try your suggestion. Thx anyway for your response Peter -
How to detect end of copy to Clipboard
PJThys replied to PJThys's topic in AutoIt General Help and Support
Thanx for your reply. The application is Questionmark Perception, a program to make electronic tests. It is a black box to me. A test consists of between 160 and 200 questions. Each separate question is made in a separate window where a lot of extra information has to be entered for electronic correction of the test. As author of a test we can make the test with QMP, but reporting or debugging the test is difficult. If we forget to fill in a correct answer to a question, we only can see that by trying out the test (fill in all questions) and at the end of the test we push the continue button and the test comes with the correct answers. Then we can check if every question has an answer. The size of the copy is unclear to me. If I cut and paste to a text editor the result is about 75 kb, but all pictures are of course removed. That's no problem for my purpouses. If I try to paste to Word it takes about 15 minutes and results in a word doc of 2 Mb. To parse that is very difficult. The size will be between 0.1 and 2 Mb I couldn't tell exactly. Writing a string to the test window is impossible, I could only write such a string to the end off the last question (which of course we will forget to remove before final publication of the test I Only want to be able to produce: 1 Flat text file with questions and answers (find spelling errors) 2 Flat text file with questionnumber and answer (to give to the students later: these would have been your correct answers) and this shows me the questions where we forgot to enter an answer 3 CSV file with questions, answers and topics for processing statistics about test (20 questions about respiratory system, 30 questions about old people, etc) I can produce all these files from the copied flat text file. I'm rewriting my script now. I had a gui where some parameters could be entered, it used messageloop-mode. I'm rewriting it to use on-event mode, suspecting that that might be the reason why my cursor is not always trapped! and then my second solution might work always btw QMP did a nice job in preventing students to cut and past or copy the final published test, I was not able to find a tool to copy the final test, when for example kleptomania, a sofisticated screengrabber was loaded, QMP refused to start, stating that I first had to remove kleptomania from memory!! -
Is there a safe way to detect when a copy to the clipboard is finished. Afterwards the contents of the clipboard need to be written to a file. This file is then parsed. Snippet: Send("^a^c") $file = FileOpen($Target & "\" & $Test & "TMP.txt", 2) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, ClipGet()) FileClose($file) gave me an empty file, only 2 sleep(10000) (one after ^a^c and one before FileClose) gave me results in 4 out of 5 cases, but slows down the process a lot. Then I tried trapping the wait cursor (cursor_id 15) Send("^a^c") MsgBox(48, "", "Wait a moment please", 3) While 1 MouseMove(5, 10) $MouseCursor = MouseGetCursor() If $MouseCursor = "15" Then While 1 MouseMove(5, 10) $MouseCursor = MouseGetCursor() If $MouseCursor = "2" Then ExitLoop 2 WEnd EndIf WEnd $file = FileOpen($Target & "\" & $Test & "TMP.txt", 2) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, ClipGet()) FileClose($file) Performance is much better, but it seems not always to trap the wait cursor (I'm not sure that it always appears). Any idea on how to find out whether ^a^c is finished writing to the clipboard? Manualy opening a text document and pasting with ^v always works, but it's rather ugly, and poses problems because of different OS and installed languages on pc's so it's more difficult to save and close notepad (different commands/window titles) Furthermore I'm not sure that the fileclose does not close the file before the clipboard is written completely to the file. Anyone knows if fileclose is waiting till filewrite is finished? Sorry for the long post, but I've been working for 2 weeks on this script and this and the previous post represent the last problems. I could live with it myself, because I discover immediatly when it doesn't run like intended and can try again, but to give it to our secretaries when it is not 'foolproof' is something else Thx in advance Peter
-
I need a safe way to trap the mouse cursor with ID 1 (appstarting) I need to fill a form, with {TAB}{SPACE}. This form has between 200 and 250 radiobuttons, I'm never sure of the exact number of radiofields. At the end of the form I need to stop. The only way to see if i'm at the end of the form is that the last control of the form is a button, when I tab to it and give a space the mousecursor changes from an arrow (ID 2) to an appstarting arrow (ID 1). That's when I need to stop. The controls on the form have no name's or handles (AutoInfo is blank!). So I decided to focus on trying to trap the change from arrow to appstarting arrow. here is the snipped: While 1 Send("{TAB}{SPACE}") MouseMove(5, 10) $MouseCursor = MouseGetCursor() If $MouseCursor = "1" Then ExitLoop WEnd It works, except that about every 1 out of 4 times the appsstarting arrow does not end the loop, even if the wanted cursor is clearly visible there for 1 or 2 seconds. I have thrown in some sleeps, even sleep(1000) but apart from slowing down the whole process, it still doesn't allways trap the appstarting arrow. Any suggestion for a more foolproof method? Thank you in advance Peter
-
I want to have a ?-mark in my windows title, left of the minimize button Top right corner of the window. This questionmark appears when i create a gui with extended style $WS_EX_CONTEXTHELP . If I click on the questionmark the cursor has to change to a cursor with questiomark and give me tooltip like information of the area on the screen I click on with this context help cursor. Standard windows behaviour. I managed to get this question mark appear (only on windows 2000, not on Windows XP ???), but I don't know how to code the standard behaviour, ie change cursor, and give tooltip-like info when clicking on the screen. Try using windowskey+pause/break and you see what i mean. thx Peter
-
I made a WS_EX_CONTEXTHELP but don't know how let it work. How to display help when clicking on the ? button thx in advance Peter
-
How to start CHM helpfile from script
PJThys replied to PJThys's topic in AutoIt General Help and Support
Been searching whole evening on google, couldn't find this about hh.exe. You're great CyberSlug Peter -
Hi, I can start a winhelp file from a script, but I would like to start a CHM file from a script (push the help button starts my help) Run("MyHelp.chm") doesn't work run(@comspec " /c start MyHelp.chm") doesn't work either (With the older winhelpfiles I could do Run("Winhlp32.exe " & @ScriptDir & "\MyHelp.hlp", but I can't figure it out with CHM files Thx in advance Peter
-
I need to get the language version of the operating system in my code for an MS Access 2000 module. Can I use the autoIt macro @OSlang in my vba code (using autoitx) and how to do that. Thanx in advance
-
Trying again
-
Hi all, Unfortunatly, i got no answers, so I post it again Despite the description of the exit codes in the helpfile, the errorlevel read under windows 98 is always 0 (probably means script ran OK!) How to get the errorlevel read as 1 if the exitcode of the script = 1. Works under windows 2000 by reading %errorlevel% in batch file. Under Windows 98 %errorlevel% gives a syntax error, and errorlevel always returns 0. If this is by design (or M$ restriction), helpfile should state that exit-codes cannot be used under windows 98 thx Peter