AutoPepe Posted December 11, 2008 Share Posted December 11, 2008 Document code : number-year I need an independant script for asigning codes to the document I make. When I have the cursor over a text field, a word processor like word, notepad, wordpad, field notes on many programs, a database text field, etc , I might be able to invoke the script and write the code in that document. Just where the cursor is. The code is formed by a sequantial number and the year : 000125-2008 Next time I invoke the script will be 000126-2008 Do you know an autoIt script doing this ? Thanks Excuse my language. I'm from Canary Islands Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Josbe Posted December 11, 2008 Share Posted December 11, 2008 Document code : number-yearI need an independant script for asigning codes to the document I make. When I have the cursor over a text field, a word processor like word, notepad, wordpad, field notes on many programs, a database text field, etc , I might be able to invoke the script and write the code in that document. Just where the cursor is. The code is formed by a sequantial number and the year : 000125-2008Next time I invoke the script will be 000126-2008Do you know an autoIt script doing this ?ThanksExcuse my language. I'm from Canary IslandsMaybe you could assign a HotKeySet(), and send the code with Send().Also check the macros page.Tal vez usted podría asignar un atajo vía HotKeySet(), y enviar el código con Send().También revise la página de macros. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
AutoPepe Posted December 11, 2008 Author Share Posted December 11, 2008 I'm translating the manual. I would like a similar scriptNobody have the same need in the past ? Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Josbe Posted December 11, 2008 Share Posted December 11, 2008 I'm translating the manual. I would like a similar scriptNobody have the same need in the past ?Did you tried the suggestion?Intentó la sugerencia? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
AutoPepe Posted December 11, 2008 Author Share Posted December 11, 2008 No. I will not try your suggestion unless my need is an original need, and anyone has made before. It's simple why. Perhaps exist a similar script. I repeat my question for reading people. Do you know an autoIt script doing this ? Do you know a MADE script doing this ? Thanks Excuse my language. I'm from Canary Islands P.D. : A lover of original scripts. A beginner and ignorant. Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 11, 2008 Developers Share Posted December 11, 2008 (edited) No. I will not try your suggestion unless my need is an original need, and anyone has made before. It's simple why. Perhaps exist a similar script. I repeat my question for reading people. Do you know an autoIt script doing this ? Do you know a MADE script doing this ?ThanksExcuse my language. I'm from Canary Islands P.D. : A lover of original scripts. A beginner and ignorant.When you are a beginner than begin at the beginning .... start building it and stop posting about it because else you slowly become irritating.Jos Edited December 11, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AutoPepe Posted December 11, 2008 Author Share Posted December 11, 2008 When you are a beginner than begin at the beginning .... start building it and stop posting about it because else you slowly become irritating.JosPerhaps I don't explain in English. I try in spanish : Cuando uno pregunta por un script ya hecho no parece apropiado responder con un script por hacer. He solicitado un subforo de peticiones de scripts hechos. La tolerancia y la no irritación (irritating) es de buenos compañeros. Así que no te enfades que seguiré con mi pregunta en la forma en que quiera hacerla. Y si te irritas allá tú. Seguimos que la conseguimos. Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Josbe Posted December 11, 2008 Share Posted December 11, 2008 Perhaps I don't explain in English. I try in spanish : Cuando uno pregunta por un script ya hecho no parece apropiado responder con un script por hacer. He solicitado un subforo de peticiones de scripts hechos. La tolerancia y la no irritación (irritating) es de buenos compañeros. Así que no te enfades que seguiré con mi pregunta en la forma en que quiera hacerla. Y si te irritas allá tú. Seguimos que la conseguimos.Well, it's possible that nobody wrote the same script in the past, like you want. But make sure about that, using the SEARCH link.Bien, es posible que nadie escribió el mismo script en el pasado, como usted desea. Asegúrese de eso, usando el enlace de SEARCH. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
AutoPepe Posted December 12, 2008 Author Share Posted December 12, 2008 Well, it's possible that nobody wrote the same script in the past, like you want. But make sure about that, using the SEARCH link.Bien, es posible que nadie escribió el mismo script en el pasado, como usted desea. Asegúrese de eso, usando el enlace de SEARCH.I tried.No result. While we are discussing I get two answers in other forums. And two post were closed in this forum for asking for a script request subforum.I'm not angry. I will continue asking on my way and accepting no answers at all in this forum. AutoIt is a great language, but depend on the size of the users of the program. It's not the same. Someday will be the same, I hope. ThanksExcuse my language. I'm from Canary Islands Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Josbe Posted December 12, 2008 Share Posted December 12, 2008 It's simple why. Perhaps exist a similar script....But make sure about that, using the SEARCH link.I tried.No result. I will continue asking on my way and accepting no answers at all in this forum.Ok, I hope someone gives you a similar script. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Robjong Posted December 12, 2008 Share Posted December 12, 2008 Hey AutoPepe, I think you will find the people on this forum will be more helpful if you show some effort from your side, post some code you have for example, just asking for code often won't work, even with a simple script like this. Link to comment Share on other sites More sharing options...
Malkey Posted December 14, 2008 Share Posted December 14, 2008 (edited) Try this example.Press keys:-Ctrl + Alt + w to write number and year. Ctrl + Alt + c to change number . Esc To exit.expandcollapse popup;#NoTrayIcon HotKeySet("!^w", "_NumberYear") ; Ctrl + Alt + w to write number and year. HotKeySet("!^c", "_ModifyNumber"); Ctrl + Alt + c to change number . HotKeySet("{ESC}", "Terminate") ; Esc To exit Global $file, $str, $aMPos, $hWnd, $IDCrtl, $iNum, $aRet, $sClassName, $tStrBuff If Not FileExists(@ScriptDir & "\NumYear.ini") Then IniWrite(@ScriptDir & "\NumYear.ini", "Number", "num", "1") $iNum = IniRead(@ScriptDir & "\NumYear.ini", "Number", "num", "NotFound") While 1 Sleep(100) WEnd #cs Func _NumberYear() Local $nCount = 0 Local $inst $aMPos = MouseGetPos() $hWnd = DllCall("user32.dll", "hwnd", "WindowFromPoint", "uint", $aMPos[0], "uint", $aMPos[1]) $tStrBuff = DllStructCreate("char[100]") $aRet = DllCall("user32.dll", "int", "GetClassName", "hwnd", $hWnd[0], "ptr", DllStructGetPtr($tStrBuff), "int", 100) $sClassName = DllStructGetData($tStrBuff, 1) Local $sClassList = WinGetClassList(WinGetTitle('')) Local $aSplitClass = StringSplit(StringTrimRight($sClassList, 1), @LF) For $iCount = $aSplitClass[0] To 1 Step -1 If $aSplitClass[$iCount] = $sClassName Then $nCount += 1 If ControlGetHandle(WinGetTitle(''), '', $aSplitClass[$iCount] & $nCount) = $hWnd[0] Then $inst = $nCount EndIf Next $str = StringFormat(" %06s-%4s ", $iNum, String(@YEAR)) WinWait(WinGetTitle('')) ControlSend(WinGetTitle(''), "", $sClassName & $inst, $str) $iNum = String($iNum + 1) GUICtrlSetData($file, $iNum) $str = "" Return EndFunc ;==>_NumberYear #ce Func _NumberYear() $str = StringFormat(" %06s-%4s ", $iNum, String(@YEAR)) WinWait(WinGetTitle('')) ControlSend(WinGetTitle(''), "", ControlGetFocus (WinGetTitle('')), $str) $iNum = String($iNum + 1) GUICtrlSetData($file, $iNum) $str = "" Return EndFunc ;==>_NumberYear Func Terminate() IniWrite(@ScriptDir & "\NumYear.ini", "Number", "num", $iNum) Exit 0 EndFunc ;==>Terminate Func _ModifyNumber() Local $file, $btn, $btn2, $msg Local $hGUI = GUICreate("Number-Year", 150, 120, -1, -1, -1, 0x00000018) GUICtrlCreateLabel("Next Number to Write", 25, 10, 120, 20) $file = GUICtrlCreateInput($iNum, 25, 35, 100, 20) $btn = GUICtrlCreateButton("Ok", 7, 75, 60, 40, BitOR(0x0300, 0x0C00)) $btn2 = GUICtrlCreateButton("Cancel ", 82, 75, 60, 40, BitOR(0x0300, 0x0C00, 0x2000)) GUISetState() $msg = 0 While $msg <> -3 $msg = GUIGetMsg() Select Case $msg = -3 Or $msg = $btn2 GUIDelete($hGUI) Case $msg = $btn $iNum = GUICtrlRead($file) IniWrite(@ScriptDir & "\NumYear.ini", "Number", "num", $iNum) GUIDelete($hGUI) EndSelect WEnd Return EndFunc ;==>_ModifyNumberEdit: Just found an easier way to use ControlSend() to the active control window. Edited December 14, 2008 by Malkey Link to comment Share on other sites More sharing options...
AutoPepe Posted December 14, 2008 Author Share Posted December 14, 2008 Thank Malkey.I'll try and comment By Esgrimidor Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now