Leaderboard
Popular Content
Showing content with the highest reputation on 01/20/2018 in all areas
-
Version 1.7.0.1
10,054 downloads
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None1 point -
As the WebDriver UDF - Help & Support thread has grown too big, I started a new one. The prior thread can be found here.1 point
-
No problem, $aArray[0] creates an empty array, you were using $aArray[1] which was creating an array with a single element/row, by default all variables are strings so that one element translated into an empty string, this is why you were seeing a single "" in the outputted JSON1 point
-
No junkew, It's definitely not just a matter of personal preferences. AddPropertyChangedEventHandler can detect hundreds of property events per second from multiple properties. Your code cannot.1 point
-
trying to work up a simple example... Her you go...hope it makes sense, if not just ask... #include <GUIConstantsEx.au3> #include <Array.au3> #AutoIt3Wrapper_Add_Constants=n Local $gui010 = GUICreate('CHK Box Example', 400, 600) ; arrays to store control ids in, one array per group Local $chkbox_group1[8] Local $chkbox_group2[15] Local $chkbox_group3[4] ; create the controls storing the ctlid in the appropriate array For $1 = 0 To UBound($chkbox_group1) - 1 $chkbox_group1[$1] = GUICtrlCreateCheckbox('ChkBox-G1 ' & StringFormat('%02i', $1), 10, $1 * 30 + 10, 100, 20) Next For $1 = 0 To UBound($chkbox_group2) - 1 $chkbox_group2[$1] = GUICtrlCreateCheckbox('ChkBox-G2 ' & StringFormat('%02i', $1), 130, $1 * 30 + 10, 100, 20) Next For $1 = 0 To UBound($chkbox_group3) - 1 $chkbox_group3[$1] = GUICtrlCreateCheckbox('ChkBox-G3 ' & StringFormat('%02i', $1), 260, $1 * 30 + 10, 100, 20) Next Local $abuttons[3] ; an array of buttons to clear each group For $1 = 0 To UBound($abuttons) - 1 $abuttons[$1] = GUICtrlCreateButton('Clear Group ' & $1 + 1, $1 * 130 + 5, 550, 100, 20) Next GUISetState() Local $msg While 1 $msg = GUIGetMsg() Switch $msg Case $gui_event_close Exit Case $abuttons[0] _clear(1) Case $abuttons[1] _clear(2) Case $abuttons[2] _clear(3) EndSwitch WEnd Func _clear($group) ; semi reasonable use of eval...resolves to $chkbox_group1 or $chkbox_group2 or $chkbox_group3... For $1 = 0 To UBound(Eval('chkbox_group' & $group)) - 1 GUICtrlSetState(Eval('chkbox_group' & $group)[$1], $gui_unchecked) Next EndFunc ;==>_clear kylomas1 point
-
kartune, You have sets of variables containing the control id's of sets of controls that you wish to manipulate as a set without repeating code for each individual variable in each set. When you create a control that you wish to manipulate you create a corresponding control id. That control id can be stored in a simple variable, e.g. $myctl = something or in an array, e.g. $checkbox[$1] = something. The problem you have is program organization, in that you need to manage control id's in sets. Arrays are perfect for that. Without example code or more detail I can't really comment in more detail. I would caution you to stay away from eval/assign if possible. Good Luck, kylomas1 point
-
RunWait redirect to file
Earthshine reacted to careca for a topic
Could it be that the linux is refusing the connection? What is the result in $code1?1 point -
Renaming a $var1 to $newvarname
Earthshine reacted to iamtheky for a topic
you can do assignments with variables, if this is headed down your mental path we probably just need to work out where in your script it would best suit, which depends a lot on how you are initially creating the controls and storing IDs as @kylomas inquired. for $i = 1 to 3 assign("var" & $i , $i) next msgbox(0, '' , eval("var1")) msgbox(0, '' , eval("var2")) msgbox(0, '' , eval("var3"))1 point -
I saw this code here: http://zoomquilt.org/ and here: http://arkadia.xyz and thought how this can be implemented in AutoIt. Here the results. The Zoomquilt: ;coded by UEZ build 2018-01-10, idea and images taken from http://zoomquilt.org/ ;thanks to spudw2k for the MouseZoom function #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit, $iW, $iH Global Const $sTitle = "GDI Image Zoom v2.1.2 coded by UEZ" AutoItSetOption("GUIOnEventMode", 1) Downloader() GDIPlus_ZoomImage() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_ZoomImage($bMultimonitor = False) $bExit = False Local $i, $aImages[46], $hImage, $hObj ConsoleWrite("Loading images from local disk..." & @CRLF) Local $fTimer = TimerInit() For $i = 0 To UBound($aImages) - 1 $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\TheZoomquilt" & StringFormat("%02i.jpg", $i)) $aImages[$i] = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) Next ConsoleWrite(UBound($aImages) & " images loaded in " & TimerDiff($fTimer) & " ms" & @CRLF) Local $tDim = DllStructCreate($tagBITMAP) DllCall("GDI32.dll", 'int', 'GetObject', 'int', $aImages[0], 'int', DllStructGetSize($tDim), 'ptr', DllStructGetPtr($tDim)) $iW = $tDim.bmWidth $iH = $tDim.bmHeight Local $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]"), $aFullScreen[4], $iW_Dt, $iH_Dt $aFullScreen = WinGetPos($hFullScreen) If $bMultimonitor Then $iW_Dt = $aFullScreen[2] $iH_Dt = $aFullScreen[3] Else $iW_Dt = @DesktopWidth $iH_Dt = @DesktopHeight $aFullScreen[0] = "" $aFullScreen[1] = "" EndIf $hGUI = GUICreate($sTitle, $iW_Dt, $iH_Dt, $aFullScreen[0], $aFullScreen[1], $WS_POPUP, $WS_EX_TOPMOST) GUISetState(@SW_SHOW, $hGUI) GUISetCursor(16, 1) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW_Dt, $iH_Dt) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC) _WinAPI_SetStretchBltMode($hDC_backbuffer, $STRETCH_DELETESCANS) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFF000000), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xFFFFFFFF), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 130, 16) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") AdlibRegister("CalcFPS", 1000) Local $a[3], $b = 1, $c, $x, $e, $y, $w, $h, $w2 = $iW_Dt / 2, $h2 = $iH_Dt / 2, $q, $r If $iW_Dt > 1.5 * $iH_Dt Then $q = $iW_Dt $r = 0.75 * $iW_Dt Else $q = 1.5 * $iH_Dt $r = 0.75 * $iH_Dt EndIf Do For $e = 0 To 2 $a[$e] = $aImages[Mod(Floor($b) + $e, UBound($aImages))] Next $c = 2^(Mod($b, 1)) For $e = 0 To 2 $x = $w2 - $q / 2 * $c $y = $h2 - $r / 2 * $c $w = $q * $c $h = $r * $c $hObj = _WinAPI_SelectObject($hMemDC, $a[$e]) _WinAPI_StretchBlt($hDC_backbuffer, $x, $y, $w, $h, $hMemDC, 0, 0, $iW, $iH, $SRCCOPY) $c *= 0.5 Next $b += MouseZoom() IF $b < 0 Then $b = UBound($aImages) - $b _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS & " @ " & $iW_Dt & "x" & $iH_Dt & " px", $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) _WinAPI_BitBlt($hDC, 0, 0, $iW_Dt, $iH_Dt, $hDC_backbuffer, 0, 0, $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(0) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hMemDC, $hObj) _WinAPI_DeleteDC($hMemDC) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) For $i = 0 To UBound($aImages) - 1 _WinAPI_DeleteObject($aImages[$i]) Next GUIDelete($hGUI) EndFunc ;==>GDIPlus_ZoomImage Func MouseZoom() ;https://www.arduino.cc/reference/en/language/functions/math/map/ Local $iInput = MouseGetPos(1), $iInMin = 0, $iInMax = @DesktopHeight, $iOutMin = 1, $iOutMax = -1, $iStep = 0.025 Return (($iInput - $iInMin) * ($iOutMax - $iOutMin) / ($iInMax - $iInMin) + $iOutMin) * $iStep EndFunc ;MouseZoom() Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func Downloader() Local $i, $A = StringSplit("FUjD9hf gbHhxTR 8YyzJdR xP3aNkR 2Qi4fQr E6pW5Ky zmtWIBF Af7LtYp TuXy30d 3nKGLr2 hNoWscB mSBvv3K f4wJ70e mIt9XmM M4TkAyh P4L4qhd hNM6bTv VoT8JXM jqcGH0B DYVoN8n bOPQkOI NeaTfJ1 18ppMNr FZ3d8Jv HsoX2RP mjv4kzI 6rpJbef pySKauq WjNQYRV Ffooo8y Xei5XfD T5A415r LiV0VNB nGcwiO4 b1Gdjjy GE828iy eSQ7SLe 1mPyGgL GNtwJIr KxBlU7E aKXhms5 9Quu2wu Y07quDf r0yC5Qa 273fCkD 2wMyCUw FUjD9hf", " ", 2) Local $sURL For $i = 0 To UBound($A) - 1 If Not FileExists(@ScriptDir & "\Images\TheZoomquilt" & StringFormat("%02i.jpg", $i)) Then If Not FileExists(@ScriptDir & "\Images") Then DirCreate(@ScriptDir & "\Images") $sURL = "http://imgur.com/" & $A[Mod(20 + $i, 46)] & ".jpg" ConsoleWrite("Downloading " & $sURL & ": " & InetGet($sURL, @ScriptDir & "\Images\TheZoomquilt" & StringFormat("%02i.jpg", $i), 8) & " bytes" & @CRLF) ToolTip("Downloading images...Please wait! -> " & $i + 1 & " / " & UBound($A), MouseGetPos(0), MouseGetPos(1)) EndIf Next ToolTip("") EndFunc ;==>Downloader Arkadia: ;coded by UEZ build 2018-01-10, idea and images taken from http://arkadia.xyz ;thanks to spudw2k for the MouseZoom function #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit, $iW, $iH Global Const $sTitle = "GDI Image Zoom v2.2.1 coded by UEZ" AutoItSetOption("GUIOnEventMode", 1) Downloader() GDIPlus_ZoomImage() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_ZoomImage($bMultimonitor = False) $bExit = False Local $i, $aImages[49], $hImage, $hObj ConsoleWrite("Loading images from local disk..." & @CRLF) Local $fTimer = TimerInit() For $i = 0 To UBound($aImages) - 1 $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Arkadia" & $i & ".jpg") $aImages[$i] = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) Next ConsoleWrite(UBound($aImages) & " images loaded in " & TimerDiff($fTimer) & " ms" & @CRLF) Local $tDim = DllStructCreate($tagBITMAP) DllCall("GDI32.dll", "int", "GetObject", "int", $aImages[0], "int", DllStructGetSize($tDim), "ptr", DllStructGetPtr($tDim)) $iW = $tDim.bmWidth $iH = $tDim.bmHeight Local $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]"), $aFullScreen[4], $iW_Dt, $iH_Dt $aFullScreen = WinGetPos($hFullScreen) If $bMultimonitor Then $iW_Dt = $aFullScreen[2] $iH_Dt = $aFullScreen[3] Else $iW_Dt = @DesktopWidth $iH_Dt = @DesktopHeight $aFullScreen[0] = "" $aFullScreen[1] = "" EndIf $hGUI = GUICreate($sTitle, $iW_Dt, $iH_Dt, $aFullScreen[0], $aFullScreen[1], $WS_POPUP, $WS_EX_TOPMOST) GUISetState(@SW_SHOW, $hGUI) GUISetCursor(16, 1) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW_Dt, $iH_Dt) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC) _WinAPI_SetStretchBltMode($hDC_backbuffer, $STRETCH_DELETESCANS) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFF000000), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xFFFFFFFF), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 130, 16) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") AdlibRegister("CalcFPS", 1000) Local $a[3], $b = 1, $c, $x, $e, $y, $w, $h, $w2 = $iW_Dt / 2, $h2 = $iH_Dt / 2, $q, $r If $iW_Dt > 1.5 * $iH_Dt Then $q = $iW_Dt $r = 0.75 * $iW_Dt Else $q = 1.5 * $iH_Dt $r = 0.75 * $iH_Dt EndIf Do For $e = 0 To 2 $a[$e] = $aImages[Mod(Floor($b) + $e, UBound($aImages))] Next $c = 2^(Mod($b, 1)) For $e = 0 To 2 $x = $w2 - $q / 2 * $c $y = $h2 - $r / 2 * $c $w = $q * $c $h = $r * $c $hObj = _WinAPI_SelectObject($hMemDC, $a[$e]) _WinAPI_StretchBlt($hDC_backbuffer, $x, $y, $w, $h, $hMemDC, 0, 0, $iW, $iH, $SRCCOPY) $c *= 0.5 Next $b += MouseZoom() IF $b < 0 Then $b = UBound($aImages) - $b _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS & " @ " & $iW_Dt & "x" & $iH_Dt & " px", $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) _WinAPI_BitBlt($hDC, 0, 0, $iW_Dt, $iH_Dt, $hDC_backbuffer, 0, 0, $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(0) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hMemDC, $hObj) _WinAPI_DeleteDC($hMemDC) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) For $i = 0 To UBound($aImages) - 1 _WinAPI_DeleteObject($aImages[$i]) Next GUIDelete($hGUI) EndFunc ;==>GDIPlus_ZoomImage Func MouseZoom() ;https://www.arduino.cc/reference/en/language/functions/math/map/ Local $iInput = MouseGetPos(1), $iInMin = 0, $iInMax = @DesktopHeight, $iOutMin = 1, $iOutMax = -1, $iStep = 0.025 Return (($iInput - $iInMin) * ($iOutMax - $iOutMin) / ($iInMax - $iInMin) + $iOutMin) * $iStep EndFunc ;MouseZoom() Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func Downloader() Local $sURL, $i For $i = 0 To 48 If Not FileExists(@ScriptDir & "\Images\Arkadia" & $i & ".jpg") Then If Not FileExists(@ScriptDir & "\Images") Then DirCreate(@ScriptDir & "\Images") $sURL = "http://arkadia.xyz/images/arkadia" & $i & ".jpg" ConsoleWrite("Downloading " & $sURL & ": " & InetGet($sURL, @ScriptDir & "\Images\Arkadia" & $i & ".jpg", 8) & " bytes" & @CRLF) ToolTip("Downloading images...Please wait! -> " & $i + 1 & " / " & $i, MouseGetPos(0), MouseGetPos(1)) EndIf Next ToolTip("") EndFunc ;==>Downloader The missing images will be download and saved to script dir in folder images. Due to internal integer format of the GDI functions the screen is little bit wobbling. Happy watching.1 point
-
Powershell command in autoit
Earthshine reacted to ptrex for a topic
Advantages using the CLR UDF are mainly no depencies needed. When compiling your Au3 scripts you can have everything in 1 EXE and it will be very portable to other machines... When using the commandline you need to involve 2 dependencies I have not compared speed between the 2 approaches though ... ?1 point