Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/24/2017 in all areas

  1. water

    OutlookEX UDF

    Based on the Outlook UDF written by wooltown, we (wooltown and I) decided to extend the functionality of the Outlook UDF. As the OutlookEX UDF ("EX" like "extended") has a completely different approach compared to the Outlook UDF it's a complete rewrite. We would like to discuss the design of the UDF with the community. Every feedback, function request etc. is highly welcome. As soon as the discussion shows that we are on the right track we would like to release an alpha version for everyone to test. So please don't be shy and post what you think of this UDF or what functions you need! Every item in Outlook is uniquely identified by EntryID and StoreID. The default StoreID is your inbox Every item has properties to describe the item (subject, startdate ..) and methods to act upon the item (move, delete …) The search and action functions are now separated. As an example the user first searches for the items to be deleted and then calls the delete function If a method can be used for more than one item type (e.g. mail, calendar and notes) the function is called _OL_ItemXXX else the function is called _OL_CalendarXXX The number of properties you can get or pass to most functions is not limited by the number of parameters defined for the function. Properties can be passed as parameters (up to 10) or in an unlimited array as parameter 1 The UDF allows to access all kind of folders (see the following listing). Folders can be passed by name or as an object to a function A lot of testing is still needed as we have written and tested the functions using Outlook 2002 SP3 and Outlook 2010 "wrapper" or "shortcut" functions will be available to let you do all tasks in one go e.g. _OL_Wrapper_SendMail for all functions above. Documentation: The documentation for this UDF (aside from the docu in the UDF itself) will be placed in the AutoIt Wiki. So we can easily modify the docu without releasing a new version each time. There will be pages describing the UDF in general and pages for individual item types (like mail) with detailed information and a lot of tips & tricks. Tested with Outlook 2003 and 2010. Some users reported that it works with Outlook 2013 as well. Starting point: http://www.autoitscript.com/wiki/OutlookEX_UDF_-_General Download
    1 point
  2. water

    Active Directory UDF (II)

    As the Active Directory UDF thread has grown too big, I start a new one. The original thread can be found here.
    1 point
  3. rynow

    romaSQL

    romaSQL This autoIt UDF is built on the concept of Laravel Query & doctrine. RomaSQL provides a new, comfortable and easy to use way for SQL-queries in autoIt. Most of the common SQL-queries are supported already and more are coming soon. All of your support is much appreciated. Connections For the connection the object ADODB is used. Therefore the connection string is based on ODBC. You can also use OLEDB connection strings or other database connections. In order for this to work your add-ons have to be installed in the function: __4ern_SQL_Connection. I’d be very glad if you shared your modifications with me. Currently supported connections - MySQL (odbc) - Microsoft SQL Server (odbc) - SQLite (odbc) - Microsoft Access (odbc) Command reference $SQL_connect; establishing connection $SQL_returnType; return a Array or Dictionary ('oDict') Object (Default = Array) $SQL_setDefaultTable; Default Tablename $SQL_setDefaultKey; Default Colmn Key (Default = id) $SQL_debug; if True, show SQL Statment in Console $SQL_get $SQL_update $SQL_delete $SQL_insertInto $SQL_take $SQL_limit $SQL_table $SQL_select $SQL_distinct $SQL_where $SQL_orWhere $SQL_whereBetween $SQL_whereNotBetween $SQL_whereIn $SQL_whereNotIn $SQL_whereNull $SQL_whereNotNull $SQL_having $SQL_orHaving $SQL_havingBetween $SQL_havingNotBetween $SQL_havingIn $SQL_havingNotIn $SQL_havingNull $SQL_havingNotNull $SQL_groupBy $SQL_orderBy Examples establishing connection ;-----/ ; SQLite Connection ;-----/ $SQL_setDatabase('sqlite') $SQL_connect('C:\project.db') ;-----/ ; Access Connection ; Database, User, Password ;-----/ $SQL_setDatabase('access') $SQL_connect('C:\project.mdb') ;or as Admin $SQL_connect('C:\project.mdb', '4ern', 'root') ;-----/ ; SQLServer Connection ; Database, User, Password, Server, Driver ;-----/ $SQL_setDatabase('sqlserver') $SQL_connect('myDB', '4ern', 'root', 'localhost') ;or with Driver $SQL_connect('myDB', '4ern', 'root', 'localhost', 'SQL Server') ;-----/ ; MySQL Connection ; Database, User, Password, Server, Driver ;-----/ $SQL_setDatabase('mysql') $SQL_connect('myDB', '4ern', 'root', 'localhost') ;or with Driver $SQL_connect('myDB', '4ern', 'root', 'localhost', 'MySQL ODBC 5.2 UNICODE Driver') simple SQL query $SQL_table('albums') $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif Select $SQL_table('albums') $SQL_select('id', 'Name', 'Artist', 'Song') ;or pass to an Array Local $aSelect = ['id', 'Name', 'Artist', 'Song'] $SQL_select($aSelect) $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif where $SQL_table('albums') $SQL_select('id', 'Name', 'Artist', 'Song', 'Votes') $SQL_where('Artist', 'adele') $SQL_where('Votes', '>=' ,'9') $SQL_orWhere('Artist', '=' ,'Rag'n'Bone Man') ;or pass to an 2dArray Local $aSelect = [['Artist','adele'],['Votes', '>=' ,'9']] $SQL_where($aSelect) $aRet = $SQL_get() if IsArray($aRet ) then _ArrayDisplay($aRet ) else ConsoleWrite('Keine Ergebnisse' & @LF) endif If you need more examples, then tell me exactly what you need. I hope you like my UDF and find some use for it. --- ->DONWLOAD romaSQL
    1 point
  4. Jos

    Sqlite3 insert problem

    Wild guess: _SQLite_Exec(-1, "INSERT INTO DepopHistory (Descrizione, txt_insert) " & _ "VALUES (" & _SQLite_FastEscape($sLDescrizione) & ",'hello boys');") Jos
    1 point
  5. As for the clinic tabs and spaces, using Subz code you could create a function to pass the codes #include <Excel.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> $sExcelFile = 'D:\Example Format.xlsx' $oExcel = _Excel_Open() $oWorkbook = _Excel_BookOpen($oExcel, $sExcelFile) ;this will open the chosen xls file. $aArray = _Excel_RangeRead($oWorkbook) Global $iPatients = HowMany() Dropdown() Func HowMany() Local $iMsg While 1 ;~ Turn input into a number $iPatients = Number(InputBox("Registration", "How Many Patients are there total?")) ; #### changed to Registration #### ;~ If user enters a string or cancels then get them to try again If $iPatients = 0 Then $iMsg = MsgBox(1, 'Registration', 'Please enter a valid number') ; #### changed to Registration #### If $iMsg = 2 Then Exit Else Return $iPatients - 1 EndIf WEnd EndFunc ;==>HowMany Func Dropdown() Local $iCount = 1, $iCurrent = 1 Local $as_Clinic = '' GUICreate("Chart", 225, 80) $idClinic = GUICtrlCreateCombo("Clinic 1", 10, 10, 120, 20) GUICtrlSetData(-1, "Clinic 2|Clinic 3|Clinic 4") $idSelect = GUICtrlCreateButton("Select", 10, 40, 60, 20) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $idSelect $sClinic = GUICtrlRead($idClinic) For $i = $iCurrent To UBound($aArray) - 1 If $aArray[$i][1] = "" Or $aArray[$i][2] = "" Or $aArray[$i][10] <> "" Then $iCount = $iCount + 1 ContinueLoop EndIf WinWaitActive("Untitled - Notepad") ;I want to manually open notepad so all 6 patients will go through the same loop ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][1] & ',' & $aArray[$i][2] & @CR) ; get the clinic specific tabs spaces etc $as_Clinic = Clinic_GetString($sClinic) For $j = 1 To $as_Clinic[0] ControlSend("[CLASS:Notepad]", "", "Edit1", $as_Clinic[$j]) Next ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][4] & @CR) $iCurrent += 1 If $i = $iCount + $iPatients Then $iCount = $i $iCurrent = $i ExitLoop EndIf Next Case $GUI_EVENT_CLOSE _Excel_Close($oExcel) Exit EndSwitch WEnd EndFunc ;==>Dropdown Func Clinic_GetString($s_Clinic) Local $s_Return = '' Switch $s_Clinic Case 'Clinic 1' $s_Return = '{TAB 2}|{RIGHT 3}' EndSwitch Return StringSplit($s_Return, '|') EndFunc ;==>Clinic_GetString Subz beat me to it
    1 point
  6. @SkysLastChance For the different Clinic settings you can just use a Switch see code below, have also fixed the user count. #include <Excel.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> $sExcelFile = @ScriptDir & '\test.xlsx' $oExcel = _Excel_Open () $oWorkbook = _Excel_BookOpen($oExcel,$sExcelFile) ;this will open the chosen xls file. $aArray = _Excel_RangeRead($oWorkbook) Global $iPatients = HowMany() Dropdown() Func HowMany() Local $iMsg While 1 ;~ Turn input into a number $iPatients = Number(InputBox("Registration", "How Many Patients are there total?")) ; #### changed to Registration #### ;~ If user enters a string or cancels then get them to try again If $iPatients = 0 Then $iMsg = MsgBox(1, 'Registration', 'Please enter a valid number') ; #### changed to Registration #### If $iMsg = 2 Then Exit Else Return $iPatients - 1 EndIf WEnd EndFunc ;==>HowMany Func Dropdown() Local $iCount = 1, $iCurrent = 1 GUICreate("Chart", 225, 80) $idClinic = GUICtrlCreateCombo("Clinic 1", 10, 10, 120, 20) GUICtrlSetData(-1, "Clinic 2|Clinic 3|Clinic 4") $idSelect = GUICtrlCreateButton("Select", 10, 40, 60, 20) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $idSelect $sClinic = GUICtrlRead($idClinic) For $i = $iCurrent To UBound($aArray) - 1 If $aArray[$i][1] = "" Or $aArray[$i][2] = "" Or $aArray[$i][10] <> "" Then $iCurrent += 1 $iCount = $iCount + 1 ContinueLoop EndIf Switch $sClinic Case "Clinic 1" WinWaitActive("Untitled - Notepad") ;I want to manually open notepad so all 6 patients will go through the same loop ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][1] & ',' & $aArray[$i][2] & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{TAB 2}")) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{RIGHT 3}")) ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][4] & @CR) Case "Clinic 2" WinWaitActive("Untitled - Notepad") ;I want to manually open notepad so all 6 patients will go through the same loop ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][1] & ',' & $aArray[$i][2] & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{TAB 3}")) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{RIGHT 4}")) ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][4] & @CR) Case "Clinic 3" WinWaitActive("Untitled - Notepad") ;I want to manually open notepad so all 6 patients will go through the same loop ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][1] & ',' & $aArray[$i][2] & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{TAB 2}")) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{RIGHT 3}")) ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][4] & @CR) Case "Clinic 4" WinWaitActive("Untitled - Notepad") ;I want to manually open notepad so all 6 patients will go through the same loop ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][1] & ',' & $aArray[$i][2] & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{TAB 3}")) ControlSend("[CLASS:Notepad]", "", "Edit1", ("{RIGHT 4}")) ControlSend("[CLASS:Notepad]", "", "Edit1", $aArray[$i][4] & @CR) EndSwitch If $i = $iCount + $iPatients Then $iCount = $i + 1 $iCurrent = $i + 1 ExitLoop EndIf Next Case $GUI_EVENT_CLOSE _Excel_Close($oExcel) Exit EndSwitch WEnd EndFunc
    1 point
  7. Don't worry about bad code, everyone has been there, I still go there, then main thing is getting the result you want first then optimize. I spend hours looking at a blank sheet trying to predict IFTTT and waste time. Reading other peoples posts and code is how you learn as well as doing your own. Once it's done you look and say, Hey, that doesn't need to be global, this repeats so I can make it a function, and other ideas pop up. The main thing for me is comments, giving variables descriptive names and also signifying what you expect the value or values to be. If you have to go back and update in months it makes it easier to get up to speed. Also when others are helping they don't have to spend time checking what $x does or $r does it they aren't loop related, (i.e For $i = ). If you used 'For $x =' in a loop then had $x +=1 after it doing something else, this leads to $x not being the value you were expecting. Regarding the globals question, $yx only appear in the clinic functions so they can be local to those functions. The clinic functions have mostly the same code so could be one function instead of having 30, one for each clinic. Either mine or Subz's code should be able to be tweaked for what you want. You might also want to send the health inspector round to 1212 One Way, there seems to be a lot of families who aren't very well
    1 point
  8. Can you check that column 10 is blank? The condition I have is: If "Last Name" = "" Or "First Name" = "" Or "Clinic" <> "" Then Continueloop If $aArray[$i][1] = "" Or $aArray[$i][2] = "" Or $aArray[$i][10] <> "" Then
    1 point
  9. mikell

    regexp questions

    $string = "scarpe" $res = StringRegExp(FileRead("1.txt"), '#' & $string & '\N+', 3) If IsArray($res) Then Msgbox(0,"", $res[0])
    1 point
  10. Melba23

    Auto pulling from webpages

    Ojito, Welcome to the AutoIt forums. When you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unnecessarily. M23
    1 point
  11. Subz

    Auto pulling from webpages

    No problem, if you have any questions regarding this thread just ask in this thread so that other posters know the history.
    1 point
  12. Subz

    Auto pulling from webpages

    Here is a simple example: #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("http://www.rodsbyreid.co.nz/gallery.html") Local $oImgs = _IEImgGetCollection($oIE) Local $iNumImg = @extended Local $i = 0, $sImgs = "" For $oImg In $oImgs ;~ Show only the source for Steve Paynes 33 Cabriolet images If StringInStr($oImg.src, "images/gallery/thumbs/payne/") Then $i += 1 $sImgs &= $oImg.src & @CRLF EndIf Next Local $sTxt = "Showing " & $i & " Of " & $iNumImg & " images on the page." & @CRLF & @CRLF ;~ Save the file to script directory FileWrite(@ScriptDir & '\Steve_Paynes_HotRods.txt', $sImgs) MsgBox($MB_SYSTEMMODAL, "Img Info", $sTxt & $sImgs) _IEQuit($oIE)
    1 point
  13. Couldn't you just do something like: #include <Excel.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> $sExcelFile = @ScriptDir & '\test.xlsx' $oExcel = _Excel_Open () $oWorkbook = _Excel_BookOpen($oExcel,$sExcelFile) ;this will open the chosen xls file. $aArray = _Excel_RangeRead($oWorkbook) Global $iPatients = HowMany() Dropdown() Func HowMany() Local $iMsg While 1 ;~ Turn input into a number $iPatients = Number(InputBox("Registration", "How Many Patients are there total?")) ; #### changed to Registration #### ;~ If user enters a string or cancels then get them to try again If $iPatients = 0 Then $iMsg = MsgBox(1, 'Registration', 'Please enter a valid number') ; #### changed to Registration #### If $iMsg = 2 Then Exit Else Return $iPatients - 1 EndIf WEnd EndFunc ;==>HowMany Func Dropdown() Local $iCount = 1, $iCurrent = 1 GUICreate("Chart", 225, 80) $idClinic = GUICtrlCreateCombo("Clinic 1", 10, 10, 120, 20) GUICtrlSetData(-1, "Clinic 2|Clinic 3|Clinic 4") $idSelect = GUICtrlCreateButton("Select", 10, 40, 60, 20) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $idSelect $sClinic = GUICtrlRead($idClinic) For $i = $iCurrent To UBound($aArray) - 1 If $aArray[$i][1] = "" Or $aArray[$i][2] = "" Or $aArray[$i][10] <> "" Then $iCount = $iCount + 1 ContinueLoop EndIf _Excel_RangeWrite($oWorkbook, Default, $sClinic, "K" & $i + 1) $aArray[$i][10] = $sClinic $iCurrent += 1 If $i = $iCount + $iPatients Then $iCount = $i $iCurrent = $i ExitLoop EndIf Next Case $GUI_EVENT_CLOSE _Excel_Close($oExcel) Exit EndSwitch WEnd EndFunc Test.xlsx
    1 point
  14. Melba23

    regexp questions

    faustf, This is a close as I can get to what I think you are asking - no need for a RegEx at all: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global $aList[] = ["gel", "#gel#uv", "scarpe", "#scarpe#scarponi#boots", "vestiti"] $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 200, 20) GUISetState() $sComboData = "" For $i = 0 To UBound($aList) - 1 If StringLeft($aList[$i], 1) <> "#" Then $sComboData &= "|" & $aList[$i] EndIf Next GUICtrlSetData($cCombo, $sComboData) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cCombo $sComboSel = GUICtrlRead($cCombo) For $i = 0 To UBound($aList) - 1 If StringInStr($aList[$i], "#" & $sComboSel & "#") Then MsgBox($MB_SYSTEMMODAL, "Selected", $aList[$i]) ExitLoop EndIf Next EndSwitch WEnd M23
    1 point
  15. #include <File.au3> #include <Array.au3> Global $csv_file = @DesktopDir & "\Book1.csv" Global $aRecords If Not _FileReadToArray($csv_file,$aRecords) Then ; MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to UBound($aRecords) -1 ConsoleWrite("ROW "&$x &" "&$aRecords[$x]&@CRLF) ; Shows the line that was read from file $csv_line_values = StringSplit($aRecords[$x], ",",1) ; Splits the line into 2 or more variables and puts them in an array For $z = 1 to UBound($csv_line_values) -1 If $z = 1 Then ConsoleWrite(" A " &$csv_line_values[$z]&@CRLF) ElseIf $z = 2 Then ConsoleWrite(" B " &$csv_line_values[$z]&@CRLF) ElseIf $z = 3 Then ConsoleWrite(" C " &$csv_line_values[$z]&@CRLF) EndIf Next ; _ArrayDisplay($csv_line_values) ; Shows what's in the array you just created. ; $csv_line_values[0] holds the number of elements in array ; $csv_line_values[1] holds the value ; $csv_line_values[2] holds the value ; etc ; Msgbox(0, 0, $csv_line_values[1]) Next
    1 point
  16. Skip the blanks by using the code in my post above. If the value isn't blank then write the data. When blank it skips the write but would still run the rest of the code after. I had a play with your code but wasn't sure what you wanted to do really. Now the excel sheet is edited and notepad isn't used. Using your code I would do it like below #include <Excel.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) Global $g_h_GUIChart, $g_id_Clinic_cbo, $g_id_Select_btn ; control globals Global $g_o_Workbook = 0 ; global for excel workbook object Global $g_i_PatientTotal = Patient_GetTotal() ; # of patients Excel_OpenWorkbook() GUI_DrawClinic() While 1 Sleep(50) WEnd Func Clinic_SetSelected() Switch GUICtrlRead($g_id_Clinic_cbo) Case 'Clinic 1' ; do something here Case 'Clinic 2' ; do something else here maybe pass parameters to Patient_SetAppointment ? EndSwitch GUISetState(@SW_HIDE, $g_h_GUIChart) ; hide the gui not delete so no need to recreate each time Patient_SetAppointment() EndFunc ;==>Clinic_SetSelected Func Excel_OpenWorkbook() Local $s_Workbook = 'D:\Downloads\Example Format.xlsx' ; simple error check If Not FileExists($s_Workbook) Then MsgBox($MB_ICONERROR, 'Workbook', 'The specified workbook was not found' & @CRLF & $s_Workbook) Program_Exit() EndIf Local $o_Excel = _Excel_Open() ; simple error check If @error Then MsgBox($MB_ICONERROR, 'Excel', 'Unable to open an excel instance') Program_Exit() EndIf $g_o_Workbook = _Excel_BookOpen($o_Excel, $s_Workbook) ; simple error check If @error Then MsgBox($MB_ICONERROR, 'Excel', 'Unable to open the workbook' & @CRLF & 'Error: ' & @error) Program_Exit() EndIf EndFunc ;==>Excel_OpenWorkbook Func GUI_DrawClinic() $g_h_GUIChart = GUICreate("Chart", 225, 80) GUISetOnEvent($GUI_EVENT_CLOSE, "Program_Exit") $g_id_Clinic_cbo = GUICtrlCreateCombo('', 10, 10, 120, 20) GUICtrlSetData(-1, "|Clinic 1|Clinic 2|Clinic 3|Clinic 4", 'Clinic 1') $g_id_Select_btn = GUICtrlCreateButton("Select", 10, 40, 60, 20) GUICtrlSetOnEvent(-1, 'Clinic_SetSelected') GUISetState() EndFunc ;==>GUI_DrawClinic Func Patient_GetTotal() Do $g_i_PatientTotal = InputBox("Registration", "How Many Patients are there in total?") ; prompt for patient # Until @error = 1 Or Number($g_i_PatientTotal) ; end if cancelled or number entered If @error Then Program_Exit() ; user cancelled Return Floor($g_i_PatientTotal) ; round down to closest integer EndFunc ;==>Patient_GetTotal Func Patient_SetAppointment() Local $av_RangeRead = _Excel_RangeRead($g_o_Workbook) ; simple error check If Not IsArray($av_RangeRead) Then MsgBox($MB_ICONERROR, 'Excel', 'Unable read the specified range' & @CRLF & 'Error: ' & @error) Program_Exit() EndIf Local $i_TotalRows = UBound($av_RangeRead) - 1 Local $i_RowCount = 0 Local Static $i_RunCount = 1 ; loop here to do what you want Do ; get patient details from array and do something with them MsgBox(0, 'Patient ' & $i_RunCount, 'patient details something, something') $i_RowCount += 1 Until $i_RowCount > 3 ; probably last row with patient details in If $i_RunCount >= $g_i_PatientTotal Then MsgBox(0, 'End', 'All patients processed'); all patient processed, exit the program Program_Exit() Else $i_RunCount += 1 GUISetState(@SW_SHOW, $g_h_GUIChart) ; show the gui to select a clinic EndIf ; ending function so no recursion EndFunc ;==>Patient_SetAppointment Func Program_Exit() GUIDelete($g_h_GUIChart) ; delete the gui, no required but nice to do ; maybe close excel ; any other clean up duties Exit ; bye EndFunc ;==>Program_Exit I would also specify the worksheet when you use the RangeRead. If the workbook has been saved with another active sheet the read will fail.
    1 point
  17. Jos

    HotKey UDF

    https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F
    1 point
  18. Again: DO NOT Download SciTE.exe but SciTE4AutoIt3 from the download page and run that installer! This will give you all the utilities like Koda and will have a working SciTE installation. Jos
    1 point
  19. Hi @31290 here is two suggestions for you. Hope they are useful. Let me know if you have any questions, i will do my best to answer $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.Load("3MTXM12.xml"); or $oXML.LoadXML(FileRead("3MTXM12.xml")) $oNodes = $oXML.SelectNodes("./AssetWarrantyDTO/AssetWarrantyResponse/AssetWarrantyResponse/AssetEntitlementData/AssetEntitlement/EndDate"); or $oNodes = $oXML.SelectNodes("//AssetEntitlement/EndDate") For $oNode In $oNodes ConsoleWrite($oNode.text&@CRLF) Next ConsoleWrite("-----------------------------------------------"&@CRLF) $oSC = ObjCreate("ScriptControl") $oSC.language = "JScript" $oSC.Eval("Array.prototype.Item = function(i){return this[i];};") $oJSON = $oSC.Eval("("&FileRead("3MTXM12.json")&")") For $i=0 To $oJSON.AssetWarrantyResponse.length-1 For $j=0 To $oJSON.AssetWarrantyResponse.Item($i).AssetEntitlementData.length-1 ConsoleWrite($oJSON.AssetWarrantyResponse.Item($i).AssetEntitlementData.Item($j).EndDate&@CRLF) Next Next
    1 point
  20. I tried the code using the Example Format.xlsx in the first post and it didn't work for me. Once this line is triggered, If $Result[$Row][1] = "" Then ContinueLoop $Row is not incremented so the returned value will always be blank. You need to alter to something like below. If $Result[$Row][1] <> "" Then $yx = $Result[$Row][1] ; [1] starts read from Column B $sWrite = _Excel_RangeWrite($oWorkbook, Default, $yx, "F" & $r) EndIf Then it runs but keeps on going until it errors. not much time to play at the moment, but I can have a look. Maybe see if Subz's code is better for you. If you want to do things the same way as your original post we can have a look at improving it.
    1 point
  21. I gues you just downloaded SciTE.exe from the Editor download page ..right? Don't do that unless you know what you are doing and simple use the SciTE4AutoIt3 installer to install the fukk SciTE4AutoIt3 version SciTE. They have indeed the same name as all scripts are geared up to use that name. Jos
    1 point
  22. Had an hour to spend this evening and may have gotten a little bit carried away and probably not exactly what you want but here it is: #include <Excel.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $iBox, $oExcel, $oWorkbook, $r = 1, $x = 3 Global $idAddress, $idApptDate, $idApptTime, $idClinic, $idDOB, $idFirstName, $idInsurance, $idLastName, $idNext, $idRef, $idPhone, $idPrevious, $idProvider, $idSave, $idSex, $idStatus, $idVisitReason, $idZip Clients() Func Clients() $sExcelFile = @ScriptDir & '\test.xlsx' $oExcel = _Excel_Open () $oWorkbook = _Excel_BookOpen($oExcel,$sExcelFile) ;this will open the chosen xls file. $aArray1 = _Excel_RangeRead($oWorkbook) $Form = GUICreate("Form", 645, 310) GUICtrlCreateLabel("id#", 335, 5, 100, 21, $SS_CENTERIMAGE) $idRef = GUICtrlCreateLabel("0", 435, 5, 250, 21, $SS_CENTERIMAGE) GUICtrlCreateLabel("Status", 10, 5, 100, 21, $SS_CENTERIMAGE) $idStatus = GUICtrlCreateInput("", 115, 5, 100, 21) GUICtrlCreateLabel("First Name", 10, 30, 100, 21, $SS_CENTERIMAGE) $idFirstName = GUICtrlCreateInput("", 115, 30, 200, 21) GUICtrlCreateLabel("Last Name", 335, 30, 100, 21, $SS_CENTERIMAGE) $idLastName = GUICtrlCreateInput("", 435, 30, 200, 21) GUICtrlCreateLabel("Date Of Birth", 10, 55, 100, 21, $SS_CENTERIMAGE) $idDOB = GUICtrlCreateDate("", 115, 55, 200, 21) GUICtrlSendMsg($idDOB, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GUICtrlCreateLabel("Sex", 335, 55, 100, 21, $SS_CENTERIMAGE) $idSex = GUICtrlCreateCombo("Select", 435, 55, 200, 21, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($idSex, "M|F", "Select") GUICtrlCreateLabel("Address", 10, 80, 100, 21, $SS_CENTERIMAGE) $idAddress = GUICtrlCreateEdit("", 115, 80, 200, 45, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL)) GUICtrlCreateLabel("Zip", 335, 80, 100, 21, $SS_CENTERIMAGE) $idZip = GUICtrlCreateInput("", 435, 80, 200, 21) GUICtrlCreateLabel("Phone", 335, 105, 100, 21, $SS_CENTERIMAGE) $idPhone = GUICtrlCreateInput("", 435, 105, 200, 21) GUICtrlCreateLabel("Visit Reason", 10, 145, 100, 21, $SS_CENTERIMAGE) $idVisitReason = GUICtrlCreateEdit("", 115, 145, 200, 45, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL)) GUICtrlCreateLabel("Insurance", 335, 145, 100, 21, $SS_CENTERIMAGE) $idInsurance = GUICtrlCreateInput("", 435, 145, 200, 21) GUICtrlCreateLabel("Provider", 335, 170, 100, 21, $SS_CENTERIMAGE) $idProvider = GUICtrlCreateInput("", 435, 170, 200, 21) GUICtrlCreateLabel("Clinic", 10, 195, 100, 21, $SS_CENTERIMAGE) $idClinic = GUICtrlCreateCombo("Select", 115, 195, 200, 21, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($idClinic, "Clinic 2|Clinic 3|Clinic 4", "Select") GUICtrlCreateLabel("Appointment Date", 10, 220, 100, 21, $SS_CENTERIMAGE) $idApptDate = GUICtrlCreateDate("", 115, 220, 200, 21) GUICtrlSendMsg($idApptDate, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GUICtrlCreateLabel("Appointment Time", 335, 220, 100, 21, $SS_CENTERIMAGE) $idApptTime = GUICtrlCreateInput("", 435, 220, 200, 21) $idSave = GUICtrlCreateButton('Save Record', 535, 250, 100, 25) GUICtrlSetState($idSave, $GUI_DISABLE) $idPrevious = GUICtrlCreateButton('< Previous Record', 10, 280, 100, 25) $idNext = GUICtrlCreateButton('Next Record >', 535, 280, 100, 25) ClientArray($aArray1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _Excel_Close($oExcel) Exit Case $idSave Case $idNext SaveArray($aArray1, Number(GUICtrlRead($idRef))) If Number(GUICtrlRead($idRef)) + 1 > UBound($aArray1) - 1 Then ContinueLoop ClientArray($aArray1, Number(GUICtrlRead($idRef)) + 1) If Number(GUICtrlRead($idRef)) = UBound($aArray1) - 1 Then GUICtrlSetState($idNext, $GUI_DISABLE) If Number(GUICtrlRead($idRef)) > 1 Then GUICtrlSetState($idPrevious, $GUI_ENABLE) Case $idPrevious SaveArray($aArray1, Number(GUICtrlRead($idRef))) If Number(GUICtrlRead($idRef)) - 1 < 1 Then ContinueLoop ClientArray($aArray1, Number(GUICtrlRead($idRef)) - 1) If Number(GUICtrlRead($idRef)) = 1 Then GUICtrlSetState($idPrevious, $GUI_DISABLE) If Number(GUICtrlRead($idRef)) < UBound($aArray1) - 1 Then GUICtrlSetState($idNext, $GUI_ENABLE) EndSwitch WEnd EndFunc Func SaveArray(ByRef $aArray, $iRef) $aArray[$iRef][0] = GuiCtrlRead($idStatus) $aArray[$iRef][1] = GuiCtrlRead($idLastName) $aArray[$iRef][2] = GuiCtrlRead($idFirstName) If GUICtrlRead($idDOB) = "" Then $aArray[$iRef][3] = "" Else $aArray[$iRef][3] = GuiCtrlRead($idDOB) EndIf $aArray[$iRef][4] = GuiCtrlRead($idSex) $aArray[$iRef][5] = GuiCtrlRead($idAddress) $aArray[$iRef][6] = GuiCtrlRead($idZip) $aArray[$iRef][7] = GuiCtrlRead($idPhone) $aArray[$iRef][8] = GuiCtrlRead($idVisitReason) $aArray[$iRef][9] = GuiCtrlRead($idInsurance) $aArray[$iRef][10] = GuiCtrlRead($idClinic) $aArray[$iRef][11] = GuiCtrlRead($idProvider) $aArray[$iRef][12] = GuiCtrlRead($idApptTime) If GUICtrlRead($idApptDate) = "" Then $aArray[$iRef][13] = "" Else GuiCtrlRead($idApptDate) EndIf EndFunc Func ClientArray(ByRef $aArray, $iRef) If UBound($aArray) - 1 < $iRef Then Return GuiCtrlSetData($idRef, $iRef) GuiCtrlSetData($idStatus, $aArray[$iRef][0]) GuiCtrlSetData($idLastName, $aArray[$iRef][1]) GuiCtrlSetData($idFirstName, $aArray[$iRef][2]) If StringLen($aArray[$iRef][3]) = 14 Then GUICtrlSendMsg($idDOB, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GuiCtrlSetData($idDOB, StringFormat("%04i\%02i\%02i" ,StringLeft($aArray[$iRef][3], 4), StringMid($aArray[$iRef][3], 5, 2), StringMid($aArray[$iRef][3], 7, 2))) ElseIf StringLen($aArray[$iRef][3]) = 0 Then GUICtrlSendMsg($idDOB, $DTM_SETFORMATW, 0, " ") Else GUICtrlSendMsg($idApptDate, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GuiCtrlSetData($idDOB, $aArray[$iRef][3]) EndIf GuiCtrlSetData($idSex, $aArray[$iRef][4]) GuiCtrlSetData($idAddress, $aArray[$iRef][5]) GuiCtrlSetData($idZip, $aArray[$iRef][6]) GuiCtrlSetData($idPhone, $aArray[$iRef][7]) GuiCtrlSetData($idVisitReason, $aArray[$iRef][8]) GuiCtrlSetData($idInsurance, $aArray[$iRef][9]) If $aArray[$iRef][10] = "" Then GuiCtrlSetData($idClinic, "Select") Else GuiCtrlSetData($idClinic, $aArray[$iRef][10]) EndIf GuiCtrlSetData($idProvider, $aArray[$iRef][11]) GuiCtrlSetData($idApptTime, $aArray[$iRef][12]) If StringLen($aArray[$iRef][13]) = 14 Then GUICtrlSendMsg($idApptDate, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GuiCtrlSetData($idApptDate, StringFormat("%04i\%02i\%02i" ,StringLeft($aArray[$iRef][13], 4), StringMid($aArray[$iRef][13], 5, 2), StringMid($aArray[$iRef][13], 7, 2))) ElseIf StringLen($aArray[$iRef][13]) = 0 Then GUICtrlSendMsg($idApptDate, $DTM_SETFORMATW, 0, " ") Else GUICtrlSendMsg($idApptDate, $DTM_SETFORMATW, 0, "yyyy/MM/dd") GuiCtrlSetData($idApptDate, $aArray[$iRef][13]) EndIf EndFunc Test.xlsx
    1 point
  23. therks

    HotKey UDF

    So I see that @Yashied hasn't been active in a while, so I'm hoping someone else paying attention to this thread can help. I seem to be having a similar issue as @bitingsock above. If another window is granted focus immediately, then the script will not recognize that the key has been released and will block all other keys from being typed. See repro script here: ;~ #include <HotKey.au3> #include <HotKey_21b.au3> #include <vkConstants.au3> $hWnd = GUICreate('Issue Test', 400, 300) GUICtrlCreateInput('', 0, 0, 400, 20) GUICtrlCreateLabel('First, press the hotkey (Win+Space). Now, without pressing space or any control keys (Alt, Win, etc) try to type anything in the input field. ' & _ 'You should notice that nothing seems to happen, and in fact all normal keys are unresponsive across windows, UNLESS you hit space or another control key.', 0, 30, 400, 100) _HotKey_Assign(BitOR($CK_WIN, $VK_SPACE), '_Test') GUISetState() Do Until GUIGetMsg() = -3 Func _Test() ;~ __HK_KeyUp($VK_SPACE) ; Uncomment to fix WinActivate($hWnd) EndFunc This seems to be because __HK_KeyUp() is not being called properly. I assume because it should be called on the WM_KEYUP or WM_SYSKEYUP message, and the monitoring window is not receiving that message because a different window is active when the key is released. I tried looking through the code to figure out where I could maybe force a check but I'm very lost. At best I could put it in the HK_WM_HOTKEY() function but I'm not sure how to get the right VK code to that function without hard coding it.
    1 point
  24. water

    Active Directory UDF

    I have converted and extended the adfunctions.au3 written by Jonathan Clelland to a full AutoIt UDF including help file, examples, ScITE integration etc. The example scripts should run fine without changes. 2016-08-18: Version: 1.4.6.0 As always: Please test before using in production! KNOWN BUGS: (Last changed: ) None AD 1.4.6.0.zip For AutoIt >= 3.3.12.0 AD 1.4.0.0.zip other versions of AutoIt
    1 point
  25. Answer to myself :@WorkingDir
    1 point
×
×
  • Create New...