Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/14/2019 in all areas

  1. If Not IsObj($Outlook) then Exit If Not IsObj($Outlook) then Exit If you use the UDFs they will do most of the hard work, simply exit if the Object does not exit. Note that unlicensed MS Office products do not create objects... Skysnake
    2 points
  2. Automate all windows and browser applications with one UDF function library. Based on the microsoft automation API this library high level supports Recognition of conttrols from EDGE, Chrome, FF, Opera, Safari and Windows native apps Small testing framework to split object repository from coding away Introduction Quickstart - Getting started quickly Simple scripts With this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoft you can recognize more controls than AutoIT can recognize "out of the box" you can use concepts from other testing frameworks like http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf http://safsdev.sourceforge.net/Default.htm coded ui testing from microsoft Some of those controls / applications are chrome browser (partly mainwindow has to be done with MSAA for navigating) chrome://accessibility in the adress bar of chrome or start with "--force-renderer-accessibility" silverlight controls Ribbon control controlbars of Excel/Word IE and FF browsers Windows Media Player Windows clock AFX .. controls (partly) .... Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's automate clicking and querying basic information It gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifying Starting threads for background on the ui automation api of microsoft (not for starters) http://en.wikipedia.org/wiki/Microsoft_UI_Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx Previous threads in general help/support Interface AutoItObject IUIAutomation ObjCreateInterface and struct tagPoint in method ElementFromPoint Be aware that API is not allways installed under XP/Vista see http://support.microsoft.com/kb/971513 Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script #AutoIt3Wrapper_UseX64=Y or N Basic example of usage / showing and retrieving the default information, will post multiple examples later Hover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the form Simple spy demo (see simplespy.au3 or use latest ZIP attachment for latest version) Main features Recognize windows and html controls for the major browsers Logical and physical description for controls (UI mapping, Application map) Simple repository logic to abstract logical and physical descriptions Store Runtime Type Information in RTI. variables Rubberbanding/highlighting of objects Simple spy to help in making / identifying the physical description Support of regular expression(s) in identifying objects recognize objects on multiple properties supported properties: name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkey The actions provided so far "leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _ "rightclick", "right", "rightdoubleclick", "rightdouble", _ "middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse" "setvalue","settextvalue" "setvalue using keys" "setValue using clipboard" "getvalue" "sendkeys", "enterstring", "type", "typetext" "invoke" "focus", "setfocus", "activate" "close" "move","setposition" "resize" "minimize", "maximize", "normal", "close", "exist", "exists" "searchcontext", "context" "highlight" "getobject","object" "attach" "capture","screenshot", "takescreenshot" "dump", "dumpthemall" "propertyvalue", "property" match on multiple properties like: name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F Support for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers like for example title, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname IAccessible, IAccessible2, ISimpleDom interfaces debuglogging to a file log.txt (no output in scitewindow) Examples Example 1 Iterating thru the different ways of representing the objects in the tree (#comment-1105548) Example 2 Finding the taskbar and clicking on the start menu button (#comment-1105680) Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info) (#comment-1108849) Example 4 that demonstrates the calculator Example 5 Automating chrome Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox Example 7 The chrome example modified to a firefox example Example 8 The other major browser Internet Explorer automated (made on Example 6 and 7) Example 9 Windows media player Example 10 Automating mach 3 (AFX windows and other hard to get recognized by AutoIT) Lot of links are broken due to forum upgrade just search for the text like "Example 11 Demonstrate Word, Notepad and Calculator actions" Example 11 Demonstrate Word, Notepad and Calculator actions ... Example 13 Details 1 about the right pane of the windows explorer Example 14 Details 2 about the right pane of the windows explorer Example 15 Details 3 about the right pane of the windows explorer Example 16 Details 4 about the right pane of the windows explorer Example 17 Details 5 about the right pane of the windows explorer WITH CACHING Example 18 Details 6 about the right pane of the windows explorer WITH VIRTUAL ITEMS Example 19 Eventhandling examples Example 20 Eventhandling examples Example 21a Eventhandling examples Internet Explorer Example 21b Eventhandling examples Internet Explorer Example 22 Eventhandling examples Follow focus Example 23 Eventhandling examples structure changed Example 24 Eventhandling examples IUIAutomationEventHandler Example 25 SAFEARRAYS Example 26 IACCESSIBLE / MSAA Example 27 IACCESSIBLE2 / MSAA Example 28 IACCESSIBLE / MSAA events Example 29 IACCESSIBLE2 events Example 30 ISimpleDOM Example 31 Notepad window move, maximize, minimize Example 32 Three browsers doing the same stuff with small differences in scripting only .. TODO Build recorder Enhance the spy with a nicer UI UI for the repository (now in the script with dot notation) Enhance mapping / identifying on multiple properties instead of 1 combined with index If speed becomes an issue use the caching logic of the MS UIA framework Add the other patterns later Generalize the concept of System Under Test of starting the SUT (for testing framework purposes) Remote running of scripts Fix issue on finding within dynamic context ... edit august 18th 2013 initial post Only zip files are needed to download , just unzip in 1 directory edit july 2016 Made V0_63 and examples works with AutoIt v3.3.14 Windows 10 tested Simple spy gives some basic code as a present Chrome latest versions seems to be having issues with IUIAutomation on tabs/buttons of mainwindow use MSAA for accessing tabsheets / buttons more cleanup to be in UDF style More comments in the source see changelog.txt for previous changes edit september 2017 All examples fixed for the IE, Firefox and Chrome browser Some small but essential fixes in UIAWrappers edit april 2018 Enhanced logic on fallback / dynamic search, still not perfect, to slow Retested with latest Chrome, FF, Edge and IE11 and some extensions to show how to get text from the webpage (examples 5,6,7) Some small bugfixes Some comments as given in forum incorporated edit may 2019 Speed enhancements on especially fallback searching UIA.CFG works now in a better way to turn on/off debug, highlighting, debug2file More stable and consistent behavior Internal cleanup and refactoring of bigger functions Checked with W10 (not tested on W7) Added some W10 properties Run with 3.3.14.5 on W10 UIA_V0_51.zip EXAMPLES_V0_5.zip UIA_V0_63.zip EXAMPLES_V0_63.zip UIA_V0_64.zip EXAMPLES_V0_64.zip EXAMPLES_V0_66.zip UIA_V0_66.zip EXAMPLES_V0_70.zip UIA_V0_70.zip
    1 point
  3. Not sure if AutoIt should be your hammer;-) This is much easier from ISE Powershell. Be carefull when you test this as its much harder to get it back from multiple folders to your origin so make a backup. clear-host #Just some testdata gci | out-file 1234.txt gci | out-file 1235.txt gci | out-file 3456.txt gci | out-file 3457.txt #actual command Get-ChildItem | ForEach-Object{ $dest='.\' + $_.name.Substring(0,3) New-Item -ItemType directory $dest -force Move-Item $_.Fullname $dest -force }
    1 point
  4. great it works 3 loops. Thats most likely due to removal of the RTI. caching in the wrappers. After a page is saved/updated/refreshed all elements get a new reference by the browser and UIA framework needs to refind them before it can interact with them. The logical properties are used to refind the technical uielement. All the sleeps should not be needed within the wrappers there is a small delay set in this variable which is used in uiaction function Global $UIA_DefaultWaitTime = 250 I am referring to the log from the wrappers there should be a folder log with files that gives you more info when debug is true named like 20190814-205525066.XML take a look at examples example 11 you can condense your script which will make it easier to maintain You can put your definitions of the identication in an array You can put your script in an array Probably you dump only 0 as $oP11 is not found try $oP12 or change definition to Local $oP11=_UIA_getObjectByFindAll($oP12, "controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND", $treescope_children)
    1 point
  5. Please try this #Include <Array.au3> $file = "db.server.name=ServerName" & @CRLF & _ "db.database.name=DatabaseName" & @CRLF & _ "db.instance.name=" & @CRLF & _ "db.port=1433" & @CRLF & _ "db.user.name=Admin" & @CRLF & _ "db.jdbc.driver=jtds" & @CRLF & _ "db.param.ssl=request" & @CRLF & _ "db.param.USENTLMV2=true" & @CRLF & _ "db.pool.exhausted.action=grow" $res = StringRegExp($file, 'db\.(?|server.name|database.name|instance.name|port)=(\N*)', 3) _ArrayDisplay($res)
    1 point
  6. Never used it myself but could be what you are looking for:
    1 point
  7. Try the following UDF, example: GUICtrlComboSetColors($Combo1,0x0078D7)
    1 point
  8. I'm on vacation, will try to look at your problem ASAP... maybe somebody else will have a while to take a look earlier.
    1 point
  9. Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Moderation Team
    1 point
  10. water

    OutlookEX UDF

    I have moved the GUI related functions (_OL_BarGroupAdd, _OL_BarGroupDelete, _OL_BarGroupGet, _OL_BarShortcutAdd, _OL_BarShortcutDelete, _OL_BarShortcutGet, _OL_NavigationFolderGet) to the new OutlookEXGUI UDF. As this functions have not been widely used I'm sure the script breaking effect will be limited to a few users This will reduce the size of OutlookEX.au3 by about 1000 lines. As the Outlook UDF will mainly grow in the GUI part, future changes will not affect OutlookEX.au3. So we get a cleaner structure for further development. You get both files as OutlookEXGUI includes OutlookEX for the core functions (_OL_Open etc.).
    1 point
  11. IanN1990, You should always use _GUICtrlListView_SetExtendedListViewStyle to set extended ListView styles. Why? Because some of the values are the same as for $WS_EX_* styles and if you add them in the creation command Windows always applies the $WS_EX styles rather than the $LVS_EX ones. M23
    1 point
  12. 23-april-2017 initial au3 library posted in examples section over here https://www.autoitscript.com/forum/topic/188158-net-common-language-runtime-clr-framework/ Introduction In this whole tread posts 1-180 a lot of learning material which I try to summarize in this post 4. Around post 180 we had a working version ready for examples section to ask more help from others to enhance the UDF a. Make use / enhance for more examples (the enduser of the udf --> see examples section in forum) b. Host the CLR runtime in a better more documented way (the technical side of the udf in this thread) Reflection and related concepts Important area in integrating interfaces, types, dynamic and related concepts all relate to reflection http://www.codeproject.com/Articles/55710/Reflection-in-NET For this we need System.Reflection.Assembly and related methods like gettype_2 and createinstanceXXX TODO Find out: System.Activator and important methods to createInstanceXXX For starters Advice to first understand high level COM concepts before you step to .NET https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?do=findComment&comment=1345621 Summary post 1-180 Hosting the CLR in CPP / Microsoft references https://code.msdn.microsoft.com/CppHostCLR-e6581ee0 https://technet.microsoft.com/nl-nl/library/ms164408 Summarized start of udf in post 68 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=4#comment-1348019 First working example of hosting .NET in post #25 #28 #29 of this thread https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346495 Some tips on the interface definitions post #33 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346569 Some example in C++ and VBA to be transformed to AutoIt in post #39 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346697 An approach by compiling in .NET https://www.autoitscript.com/forum/topic/166704-net-compiled-dll-assembly-in-autoit-the-simple-approach/ Lots of reading references in post #47,#48, #49 The common language interface CLI standard ECMA 335 https://www.ecma-international.org/publications/standards/Ecma-335.htm some nice code project references https://www.codeproject.com/Articles/607352/Injecting-Net-Assemblies-Into-Unmanaged-Processes Some references on how other scripting languages deal with .NET Hp uft vbscript http://www.learnqtp.com/dotnetfactory-qtp-part7-arraylist/ PHP http://php.net/manual/en/class.dotnet.php Visual foxpro https://west-wind.com/wwdotnetbridge.aspx and http://foxcentral.net/microsoft/netforvfpdevelopers.htm powerbasic https://forum.powerbasic.com/forum/user-to-user-discussions/programming-with-objects/47869-passing-interface-to-function-to-be-created?p=567769#post567769 Summary in post #116 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=6#comment-1349309 Technical background Some other relevant articles related to AutoIt and this CLR stuff MSCorEE.DLL and MSCORLIB.DLL by googling the internet Books to read http://www.charlespetzold.com/dotnet/ A must read free pdf for understanding .net .NET CLR via C# https://www.amazon.com/CLR-via-4th-Developer-Reference/dp/0735667454 free chapters 21,22,23 can be found on the internet Lengthy list of references used in the thread (clean / sort later in a logical order) http:// https://autohotkey.com/boards/viewtopic.php?t=4633 https://code.msdn.microsoft.com/windowsdesktop/CppHostCLR-e6581ee0 http://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/320083-guide-loading-net-4-0-clr.html https://blogs.msdn.microsoft.com/carlos/2013/08/23/loading-multiple-clr-runtimes-inproc-sxs-sample-code/ Small dll's so you can use it without registering .NET classed as com https://soraco.co/quick-license-manager/vba-dotnet/ Call .NET methods from VBA http://stackoverflow.com/questions/37074533/how-to-call-net-methods-from-excel-vba Register the .NET classes with regasm https://msdn.microsoft.com/en-us/library/zsfww439(v=vs.100).aspx
    1 point
  13. What I posted is only one example and it should grab StdOut and StdErr as soon as Run returned. Try this: $sCMD = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command . " & _ "'D:\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; Enable-Mailbox -Identity " & _ $Kurzzeichen & " -Alias " & $Kurzzeichen & " -Database " & $sEXDatabase & $sSMTPAddress $pid = Run($sCMD, @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD) StdinWrite($pid, @CRLF) StdinWrite($pid) ; Ausgabe von STDOUT $sSTDOUT = "" While 1 $sOutput = StdoutRead($pid) If @error Then ExitLoop If $sOutput <> "" Then $sSTDOUT = $sSTDOUT & @CRLF & $sOutput ConsoleWrite($sOutput & @CRLF) EndIf WEnd ; Ausgabe von STDERR $sSTDERR = "" While 1 $sOutput = StderrRead($pid) If @error Then ExitLoop If $sOutput <> "" Then $sSTDERR = $sSTDERR & @CRLF & $sOutput ConsoleWrite($sOutput & @CRLF) EndIf WEnd
    1 point
×
×
  • Create New...