Jump to content

13lack13lade

Active Members
  • Posts

    377
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    13lack13lade got a reaction from JoeBar in IE Automation - Save file as   
    Made it easier for people to understand how to edit this code to make it usable for them.
    #include <IE.au3> ;open survey ie link Local $oIE = _IECreate(url) ;change url to your specific url Local $dCSV = _IEGetObjById($oIE,objIDname) ;find obj id to click on specific to your page _IEAction ($dCSV,"click") ;click object e.g download button sleep(1000) ;focus download dialog - dont need to change any of this $hIE = WinGetHandle("[Class:IEFrame]") $hCtrl = ControlGetHandle($hIE,"","[Class:DirectUIHWND]") $aPos = ControlGetPos($hIE,"",$hCtrl) $x = $aPos[2]-160 $y = $aPos[3]-30 ;Use - dont need to change any of this WinActivate($hIE) ;doesn't work in the background ControlClick($hIE,"",$hCtrl,"primary",1,$x,$y) ;this only gives focus to the save button ControlSend($hIE,"",$hCtrl,"{down}") ;this does work once the save button is focussed ControlSend($hie, "", "[Class:DirectUIHWND]","a") ;save as - Dont need to change any of this except for filepath. WinActivate("Save As", "Save"); WinWaitActive("Save As", "Save", 10); ControlSetText("Save As", "", "Edit1", filepath); ControlClick("Save As", "", "&Save", "left", 1, 5, 5); sleep(100) ControlClick("Confirm Save As","","Button1", "left", 1, 0, 0); ;quit ie _IEQuit($oIE)
  2. Like
    13lack13lade reacted to InnI in Check Checkbox by Name   
    #include "CUIAutomation2.au3" $Checked = _GetCheckBoxState(ControlGetHandle("Personal Options", "", "[NAME:chkShortPortfolios]")) If Not @error And Not $Checked Then ControlSend("Personal Options", "", "[NAME:chkShortPortfolios]", "{space}") Func _GetCheckBoxState($hControl) Local $oUIAutomation, $pElement, $oElement, $iState, $iErrorCode $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) If Not IsObj($oUIAutomation) Then Return SetError(1, 0, -1) $oUIAutomation.ElementFromHandle($hControl, $pElement) $oElement = ObjCreateInterface($pElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) If Not IsObj($oElement) Then Return SetError(2, 0, -1) $iErrorCode = $oElement.GetCurrentPropertyValue($UIA_ToggleToggleStatePropertyId, $iState) If $iErrorCode Then Return SetError(3, 0, -1) Return $iState EndFunc  
  3. Like
    13lack13lade got a reaction from SushantTompe in ExcelChart UDF - Example Scripts   
    I have a question!!!!!
    Is it possible to re-create these graphs or say a dashboard of graphs from excel without having them displayed in excel?
    For example i am wanting to make an Autoit GUI where they can load the dashboard which is linked to shared spreadsheets that are constantly updated to give a real-time display of the data however not within excel and rather in the Autoit Window itself... is this possible?
    *sorry if this is in the wrong section*
  4. Like
    13lack13lade reacted to GreenCan in ADO: Start a section in the Wiki   
    Hi water,

    Microsoft ODBC for Oracle
    DRIVER={Microsoft ODBC for Oracle};SERVER=xxxxxxxxx;User Id=xxxxxxxxx;Password=xxxxxxxxx;

    Oracle (11g in this example):
    DRIVER={Oracle in OraClient11g_home1};DBQ=xxxxxxxxx;uid=xxxxxxxxx;pwd=xxxxxxxxx;

    MSSQL
    DRIVER={SQL Server};SERVER=xxxxxxxxx;DATABASE=xxxxxxxxx;Trusted_Connection=no;uid=xxxxxxxxx;pwd=xxxxxxxxx;

    Microsoft text (a database? yes of course)
    DRIVER={Microsoft Text Driver (*.txt; *.csv)};Dbq=xxxxxxxxx;Extensions=asc,csv,tab,txt;

    dBase, Clipper, Borland... (remember the good old times...):
    DRIVER={Microsoft dBase Driver (*.dbf)};Dbq=xxxxxxxxx;

    MSAccess:
    DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=xxxxxxxxx;uid=xxxxxxxxx;pwd=xxxxxxxxx;

    SQLite ODBC:
    DRIVER={SQLite3 ODBC Driver (*)};Database=xxxxxxxxx;

    Adaptive Server Anywhere (Not tested !!!!)
    DRIVER={Adaptive Server Anywhere 9.0 (*)};Srvr=xxxxxxxxx;Dbf=xxxxxxxxx;uid=xxxxxxxxx;pwd=xxxxxxxxx;

    MySQL
    DRIVER={MySQL ODBC 5.1 Driver (*)};Server==xxxxxxxxx;Database==xxxxxxxxx;Option=16834;Uid==xxxxxxxxx;Pwd==xxxxxxxxx;

    Excel
    DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};dbq=xxxxxxxxx;

    Word:
    Are you crazy? this is no database...
  5. Like
    13lack13lade reacted to water in ADO: Start a section in the Wiki   
    ADO (ActiveX Data Objects) is a set of Component Object Model (COM) objects for accessing data sources like text files, Excel workbooks, databases (e.g. MS SQL, Oracle, MySQL), directory services (e.g. Active Directory, OpenLDAP).
    There are many examples on the forum but a documentation that puts it all together is missing.

    If you would like to see such a section in the Wiki then please answer the question in the poll and post the data source you would like to see documented (text file, MS SQL, Excel ...)

    (Stripped down) Example by GreenCan:

    $sPath_to_database = "C:\Temp\text delimited files" $connection = "DRIVER={Microsoft Text Driver (*.txt; *.csv)};Dbq=" & $sPath_to_database & ";Extensions=asc,csv,tab,txt;" $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open($connection) If @error Then Exit MsgBox(48, "Error", "error " & @error) $adoRs = ObjCreate("ADODB.Recordset") $adoSQL = "SELECT * FROM Countries.csv" $adoRs.CursorType = 2 $adoRs.LockType = 3 $adoRs.Open($adoSQL, $adoCon) With $adoRs If .RecordCount Then While Not .EOF $sResult = $sResult & "" & .Fields("Continent").Value & "|" & .Fields("alpha_2").Value & "|" & .Fields("English_Country_Name").Value & @CR .MoveNext WEnd EndIf EndWith $adoCon.Close MsgBox(0, "Result", $sResult)
  6. Like
    13lack13lade reacted to InunoTaishou in Auto clicker combined with Random.org   
    ; Set the End key to call the RandomClick function HotKeySet("{End}", "_RandomClick") ; Maximum number of clicks and the maximum delay between each click Global $maxClicks = 10, $maxDelay = 500 ; Infinite while loop that prevents the script from closing. Putting a slight delay so the script doesn't eat up CPU. While 1 Sleep(100) WEnd ; The function. Func _RandomClick() ; For loop. It will do everything after line 15 and before line 18 a Random number of times (Random(0, Random(0, $maxClicks)) For $i = 0 To Random(0, Random(0, $maxClicks)) MouseClick("Left", Random(0, Random(0, @DesktopWidth)), Random(0, Random(0, @DesktopHeight)), Random(1, 3), 5) Sleep(Random(0, Random(0, $maxDelay) Next EndFunc
  7. Like
    13lack13lade reacted to JohnOne in Paste Chinese Text in SciTE?   
    Yes.
    But without the false BOM information.
  8. Like
    13lack13lade reacted to MikahS in Identifying a word   
    I think everyone is waiting for your explanation of this image you are trying to mess around with.
  9. Like
    13lack13lade reacted to jdelaney in Is AutoIt what I need?   
    I prefer vbscript (autoit) like syntax over javascript?(ahk) like snytax, anyday
  10. Like
    13lack13lade reacted to water in Openning an Excel Workbook without updating links   
    With my modified version you set the parameter to 3 and all links are updated.
  11. Like
    13lack13lade reacted to willichan in Openning an Excel Workbook without updating links   
    I am not sure you can open a workbook to be updated without Excel prompting you (depends on your settings in Excel).  But with this, you can open without updates, ensuring that your script will not be held up by an update prompt.
  12. Like
    13lack13lade reacted to water in Openning an Excel Workbook without updating links   
    I will add this to the official Excel UDF.
  13. Like
    13lack13lade reacted to willichan in Openning an Excel Workbook without updating links   
    I have seen some threads where others have been looking for the ability to open an Excel workbook, and not be prompted about updating the linked data.  I had need of this myself, so below is a modified version of _Excel_BookOpen() from the Excel UDF that will not prompt, and will allow you script to continue unimpeeded by linked data.  You will still need to #Include <Excel.udf> to use this
    ; #FUNCTION# ==================================================================================================================== ; Author ........: SEO <locodarwin at yahoo dot com> ; Modified.......: litlmike, water, GMK, willichan ; =============================================================================================================================== Func _Excel_BookOpen_NoUpdate($oExcel, $sFilePath, $bReadOnly = Default, $bVisible = Default, $sPassword = Default, $sWritePassword = Default) If Not IsObj($oExcel) Or ObjName($oExcel, 1) <> "_Application" Then Return SetError(1, @error, 0) If Not FileExists($sFilePath) Then Return SetError(2, 0, 0) If $bReadOnly = Default Then $bReadOnly = False If $bVisible = Default Then $bVisible = True ;; changing the second parameter on the following line to a 0 tells Excel not to update any links. Local $oWorkbook = $oExcel.Workbooks.Open($sFilePath, 0, $bReadOnly, Default, $sPassword, $sWritePassword) If @error Then Return SetError(3, @error, 0) $oExcel.Windows($oWorkbook.Name).Visible = $bVisible ; If a read-write workbook was opened read-only then return an error If $bReadOnly = False And $oWorkbook.Readonly = True Then Return SetError(4, 0, $oWorkbook) Return $oWorkbook EndFunc ;==>_Excel_BookOpen_NoUpdate Valid alternate values are:
    0: Don't update any references
    1: Update external references, but not remote references
    2: Update remote references, but not external references
    3: Update both remote and external references
     
  14. Like
    13lack13lade reacted to AutID in ImageSearch doesn't work at all.   
    What is your problem? What is not working? What is the error? Where are my keys? Where is my phone?
    There are a lot of unanswered question in the universe. But on the other hand, there are a lot of stupid questions. So it better stays this way.
     
    Welcome to the forum even if I don't believe that you are a newcomer!

    A small tip is to use IE UDF since you are automating a website. Or better, WinHttp UDF. Do yourself a favor, search.

     
  15. Like
    13lack13lade reacted to Muzaiyan in problem with deleting temp files   
    try using DOS
    RunWait(@ComSpec & ' /C rd /s /q "' & @TempDir & '"', @SystemDir, @SW_HIDE)
  16. Like
    13lack13lade reacted to water in Excel Save   
    In the latest version the command syntax has changed a bit:
    _Excel_BookOpen _Excel_BookSave _Excel_BookClose
  17. Like
    13lack13lade reacted to Piyu in how to use include in C# -visual studio   
    Hi ,
    I want to use Autoit in C# so after adding reference and using below code ,I am able to invoke my application in C# using Visual Studio2010
    using System; using System.Text; using AutoItX3Lib; using System.Runtime.InteropServices; namespace useAutoItCode { class Program { public static void Main(string[] args) { AutoItX3Lib.AutoItX3 autoit = new AutoItX3Lib.AutoItX3(); autoit.Run(@"C:\ApplicationPath.EXE","",autoit.SW_SHOW); } I want to access Menu, tree view option of my application hence by referring to below code it is working in AUTOIT editor.
    I am new to Autoit and programming and want to know how to use directives #include <GuiTreeView.au3> and access menu,tree view objects in C#. Could you please advice? Thank you
    #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> Example() Func Example() Local $aidItem[10], $iRand, $idTreeView Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS) GUICreate("TreeView Select Item", 400, 300) $idTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState(@SW_SHOW) _GUICtrlTreeView_BeginUpdate($idTreeView) For $x = 0 To 9 $aidItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $idTreeView) For $y = 1 To 3 GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Child", $y), $aidItem[$x]) Next Next _GUICtrlTreeView_EndUpdate($idTreeView) $iRand = Random(0, 9, 1) _GUICtrlTreeView_SelectItem($idTreeView, $aidItem[$iRand]) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example  
     
     
     
     
       
     
  18. Like
    13lack13lade got a reaction from czardas in _NowDate Format Help   
    Func _Convert($date)    Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1') EndFunc $today = _NowCalcDate() $yesterday = _DateAdd('d', -1, $today)   you guys are legends! thanks for the help. 
  19. Like
    13lack13lade reacted to kylomas in _NowDate Format Help   
    Doh!   K.I.S.S.
  20. Like
    13lack13lade reacted to AZJIO in Tools for Notepad++   
    Place the Notepad ++ in the AutoIt3 folder
    Just replace the files in your Notepad++. The path must be "AutoIt3Notepad++"

    NotepadPlus.7z (v6.5.3 Ru, 4.9 Mb)



    shortcuts.xml, Contains commands:
    F5 - Start File (Alt + F5 - Setting)
    F6 - Start Script (ConsoleWrite) (Ctrl + F6 - Setting)
    Alt + F - Jump to function as a SciTE 
    Alt+X - AutoIt3Wrapper (Ctrl + F6 - ConsoleWrite)
    Alt + Z - Tidy.exe %1 /refc /reel /bdir=C:AutoIt3BackUp
    Alt+i - Au3Info.exe
    Alt + R - ToolsRegExpRegExp.exe
    Alt + F1 (F2, F3) - HELP_AutoIt3.au3
    Alt+F6 - Converter AU3 to BBcode
    Alt + F8 - list_var_funk.au3
    Alt + Shift + A - txt2au3
    Alt + G - JumpRegCMD
    Alt+Shift+D - Remove spaces
    Alt + K - Strip Comments
    Alt + L - Debugger
    Alt + F - JumpFunc
    Alt + N - CreateNewFile
    Alt + O - OpenToExplorer
    Alt + F7 - Renaming variables
    Ctrl + F7 - Include_Helper
    Ctrl + F9 - panel_function
    Ctrl + F12 - JumpToString
    Ctrl + 1 (2 ,3 ,4 ,5) - Set the color of the selected
    Ctrl + Shift + 1 (2 ,3 ,4 ,5) - Remove the color of the selected
    Ctrl + Shift + 0 - Remove the color of all selected


    langs.xml
    Added registered functions, operators and keywords

    themes
    AutoIt_Def.xml
    AutoIt+Zenburn.xml

    autoit.xml, batch.xml (for example enter "ms" and press "Enter")

    XBrackets.dll - sets closing brackets (disabled by default)
    NppExec.dll - Ctrl + F6 - for ConsoleWrite
    FunctionList.dll - List of functions
    NppSnippets.dll
    ScrollPastEOFUni.dll
     
     
    >JumpToString (Notepad++)
    >Include_Helper
    >Renaming variables
    >Debugger
  21. Like
    13lack13lade reacted to jdelaney in HELP!!! built over script   
    JLogan3o13's is a really good idea.  You can use relative paths, also (example of copying the script [named test2.au3] to c:test2.au3, when running as a compiled script
    FileInstall(".\test2.au3","c:\test2.au3") Oh, and it's a good idea to set the overwrite flag, and to modify the destination file to make sure it is read/writeable, or the copy over may not work:
    $destFile = @ScriptDir & "\" & @ScriptName & "_from_compiled.au3" If FileExists($destFile) Then FileSetAttrib($destFile,"-R") FileInstall(".\test2.au3",$destFile,1)
  22. Like
    13lack13lade reacted to JLogan3o13 in HELP!!! built over script   
    You can also add the following to the top of your script in the future. That way, should you need it, you can always get a copy of the source:
    If StringInStr($cmdlineRaw, "/Extract") Then FileInstall("<full path to .au3 file>", @TempDir & "\Source.au3", 1) EndIf
  23. Like
    13lack13lade got a reaction from jdelaney in HELP!!! built over script   
    After some research i discovered what you will need to do to get it back 'decompile' which is a nono on here for obvious reasons, sucks for me since i genuinely just want MY file back but as stated, obvious reasons why this isnt allowed..  my own fault, live and learn!
    Ive got an old version of the script i will have to redo the changes and as you said, chance to improve!!
  24. Like
    13lack13lade reacted to water in editbox linked to word doc   
    Try the example script provided with _GUICtrlRichEdit_Create.
  25. Like
    13lack13lade reacted to BrewManNH in GUIDELETE   
    GUISetState ( @SW_HIDE , <winhandle> )
×
×
  • Create New...