Leaderboard
Popular Content
Showing content with the highest reputation on 09/18/2023 in all areas
-
IDK. 🤷♂️ Hopefully someone else will jump in with some additional ideas for you.1 point
-
i figured out the issue. the email had a png file for the signature. was saving that with the zip file name. doh! thought id follow up in case anyone else had the same issue.1 point
-
You need to call __WD_Startup before you call _WD_CreateSession, not after.1 point
-
Parent window automatically hiding
Andreik reacted to argumentum for a topic
English is hard. Code is easy. Post the code, that I could run on my side, and I'll show the code that works.1 point -
I think @AllenAA's suggestion to use Shell COM objects is one of, if not the best, solution for changing the Explorer's path. Of course if more than one Explorer window was open, the example that he provided would've changed the path of all of those Explorer windows. The example below shows how to open a new Explorer window and only manipulate that specific window. If using COM is the accepted solution for this topic, then credit should go to @AllenAA for suggesting it, not me. I'm simply providing a more detailed example to help the original poster understand how a single Explorer window can be manipulated - as was requested in his original post. Example: (Click below to view)1 point
-
You can delete it this way: #include <File.au3> #include <MsgBoxConstants.au3> If Delete_U() Then MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Delete_U", "OK") Else MsgBox($MB_ICONWARNING + $MB_TOPMOST, "Delete_U", "Error") EndIf Func Delete_U() Local $sFilePath = 'G:\Session_Master' Local $sMask = "*.u*" Local $sNameLock = "Session_Undo" Local $iReturn = $FLTAR_FILES Local $aArrayF = _FileListToArrayRec($sFilePath, $sMask, $iReturn, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) Local $F_Error = @error, $iDr = 0 If $F_Error < 1 And IsArray($aArrayF) Then For $i = 1 To $aArrayF[0] If StringInStr($aArrayF[$i], $sNameLock) Then $iDr = FileDelete($aArrayF[$i] & @CRLF) If $iDr > 0 Then ConsoleWrite("+ [" & $i & "] File Deleted: " & $aArrayF[$i] & @CRLF) Else ConsoleWrite("! [" & $i & "] File not Deleted: " & $aArrayF[$i] & @CRLF) $F_Error += 1 EndIf $iDr = 0 EndIf Next Return SetError($F_Error, 0, $F_Error > 1 ? 0 : 1) Else ConsoleWrite("Error (" & $F_Error & ") No " & $sMask & " files found in: " & $sFilePath & @CRLF) Return SetError(0, 0, 1) EndIf EndFunc ;==>Delete_U1 point
-
running script in Scite getting >Access is denied?
SkysLastChance reacted to mLipok for a topic
In fact better solution is to add some exclusion in your AV software. But @SkysLastChance hit the solution.1 point -
Local $oShell = ObjCreate('Shell.Application') For $oWindow In $oShell.Windows $oWindow.navigate("d:\") Next1 point
-
$hWnd = WinActive("User Data") If $hWnd Then ControlCommand($hWnd, "", "ToolbarWindow323", "SendCommandID", 1280) ControlSetText($hWnd, "", "Edit1", @LocalAppDataDir & "\Google\Chrome\User Data\Default") ControlSend($hWnd, "", "Edit1", "{ENTER}") EndIf take a look, maybe it will help 209083-au3info-not-working-anymore you can alternatively use Control Viewer , as a reserve1 point
-
If you want to reuse the Explorer window, then I would suggest getting its handle. With its handle, you can activate/reference it without having to keep up with whatever the current title may be. I would also suggest sending alt+d to access the explorer's address bar instead of ControlClick(). From there, you can send or paste your path as you are doing now. Example: #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> Opt('WinTitleMatchMode', -2) Opt('SendKeyDelay', 0) example() Func example() Local $hWnd = -1 ;Open an explorer window ShellExecute("explorer", @DesktopDir) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "Error", "Unable to open explorer") ;Wait for the explorer window to become active and get its handle $hWnd = WinWaitActive("desktop", "", 3) If Not $hWnd Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "Error", "Timeout occurred waiting for window to become active.") MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Info", "Hit OK to go to the Program Files") ;Change explorer path to "C:\Program Files" $hWnd = WinActivate($hWnd) If Not $hWnd Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "Error", "Unable to activate the explorer window.") Send("!d") Send("C:\Program Files{ENTER}") MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Info", "Hit OK to go to the C:\Windows\System32") ;Change explorer path to "C:\Windows\System32" $hWnd = WinActivate($hWnd) If Not $hWnd Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "Error", "Unable to activate the explorer window.") Send("!d") Send("C:\Windows\System32{ENTER}") MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Info", "Script finished.") EndFunc1 point
-
ChatGPT API Call
VipinNaudiyal reacted to SzymonN for a topic
Working version for 07.2023 #include <MsgBoxConstants.au3> #include <WinHttp.au3> Func ChatGPT_Request($message) Local $apiKey = "API_KEY" Local $url = "https://api.openai.com/v1/chat/completions" Local $headers = "Content-Type: application/json" & @CRLF & "Authorization: Bearer " & $apiKey Local $data = '{"model": "text-davinci-003", "messages": [{"role": "system", "content": "user: ' & $message & '"}]}' Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("POST", $url, False) $oHTTP.SetRequestHeader("Content-Type", "application/json") $oHTTP.SetRequestHeader("Authorization", "Bearer " & $apiKey) $oHTTP.Send($data) Local $response = $oHTTP.ResponseText Return $response EndFunc Local $userMessage = "Hello my friend, how are you?" Local $response = ChatGPT_Request($userMessage) MsgBox($MB_OK, "Answer from ChatGPT", $response) ConsoleWrite($response)1 point -
When you create control on the Tab by UDF function (_GUICtrlCreate) and not by internal AutoIt's function (GUICtrlCreate) you must show/hide this control yourself. #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <IPAddressConstants.au3> #include <TabConstants.au3> #include <GuiIPAddress.au3> #include <GuiTab.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 593, 453, 193, 115) $Tab1 = GUICtrlCreateTab(16, 24, 521, 385) $hTab = GUICtrlGetHandle($Tab1) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 56, 112, 130, 21) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $MyButton1 = GUICtrlCreateButton("MyButton1", 104, 120, 100, 30, 0) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab, $fValid $hWndTab = $hTab $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTab Switch $iCode Case $TCN_SELCHANGE If _GUICtrlTab_GetCurSel($hTab) = 0 Then ; zero based index of current selected TabItem _GUICtrlIpAddress_ShowHide ($IPAddress1, @SW_SHOW) Else _GUICtrlIpAddress_ShowHide ($IPAddress1, @SW_HIDE) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Core of solution is to catch $TCN_SELCHANGE notification - when selection changes and show/hide what you want. Here is original post by Gary which I used as start for my example. http://www.autoitscript.com/forum/index.ph...st&p=4211341 point