Recently Browsing 0 members
No registered users viewing this page.
Hi guys! i want to write speedy and very fast code to check if chosen filename exists then add "-1" at end of it and if chosen filename exists again, add "-2" instead of "-1" and check filename until be unique.
For Example: I have to write "Filename.txt" in C:\ directory with FileOpen then check if "Filename.txt" exists in that directory then rename chosen filename to "Filename-2.txt" and if exists again in directory, rename chosen filename to "Filename-3.txt" and do this work until to find unique number to add end of filename.
====================== SOLUTION by @Subz ======================
Hello all! I'm stuck at a seemingly simple part of my script. Using IE, I'm filling out a web form that involves clicking a "Browse" button and selecting a file. Once the file explorer dialog opens, however, I am unable to control it.
I have a string, which is the name of the file I want, and I'm trying to insert it into the 'File name:' text box in the dialog (which already has focus), but it doesn't get inserted. I've tried ClipPut and Send.
What's even more concerning is, when I close the dialog, the string is then pasted into the very next window that has focus, which is often SciTE. It's like that Browse's file open dialog halts all processes. Once it's closed, the script continues.
;~ Open a IE window and navigate to the login page. Global $oIE = _IECreate($urlBBLogin) _IELoadWait($oIE) ;~ Recognize the form on this page (login input boxes). Local $oForm = _IEFormGetObjByName($oIE, "login") Local $oTextLogin = _IEFormElementGetObjByName($oForm, "user_id") Local $oTextPass = _IEFormElementGetObjByName($oForm, "password") ;~ Enter the Automation user credentials into the form. _IEFormElementSetValue($oTextLogin, $bbUsername) _IEFormElementSetValue($oTextPass, $bbPassword) ;~ Click the Login button. _IEFormSubmit($oForm) _IELoadWait($oIE) ;~ Navigate to the feedfile upload page. _IENavigate($oIE, $urlUpload) _IELoadWait($oIE) ;~ Click the Browse button Local $Browse = _IEGetObjById($oIE, "feedFile_chooseLocalFile") _IEAction($Browse, "Click") Local $Browse = WinWait("Choose File to Upload") ;~ Open the file we created. WinActivate($Browse) Send($finalFile) Has anyone else experienced this problem? Any ideas to get around it? Am I approaching this the wrong way?
Any support is greatly appreciated.
First I apologise to you for the stupid question I'm going to ask.
is the default style for Windows created using AutoIt a dialog box style?
I decided to ask this question
Because I am using a screen reader
If i open any program that is designed using autoit, the screen reader read for example,
but If i open any other program, for example goldwave, it read goldwav only without a word dialog
Is there a solution to this
The code i used to create the window is:
$hGUI = GUICreate(str("title"), 500, 420, -1, -1, BitOr($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_SYSMENU, $WS_CAPTION), BitOr($WS_EX_ACCEPTFILES,$WS_EX_LAYERED,$WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
I hope to find a solution to this problem
please Accept my greetings, and thank you very much.
Default keyword for optional parameter is interpreted wrongly.
ConsoleWrite(StringReplace("aa", "a", "b", Default, 1) & @CRLF) StringReplace ( "string", "searchstring/start", "replacestring" [, occurrence = 0 [, casesense = 0]] ) The code above will output ab even thou the default value for the occurrence is 0 (replace all).
Of course using zero instead of Default will work fine.
I'm trying to:
-Select a file in a folder (to store it to an ini file)
-Write the file on an ini
-Copy files to the folder selected by the user
instead of using FileOpenDialog then FileSelectFolder, I was wondering if it was possible to do the whole thing only with FileOpenDialog spliting the value returned in 2 variables. I got something like that for the first part (select a file and store it to an ini file)
Local $message = "Select your executable" Local $pathk = FileOpenDialog($message, "C:" & "", "Select the executable you want to terminate (*.exe)", 1 + 4) Local $path = "None" ;ici je dois copier les fichiers $split = StringSplit($pathk, "\") $tokill = $split[$split] If @error Then MsgBox(4096, "", "No Executable chosen") Else MsgBox(4096, "", $pathk & " Will be terminated " & @LF & @LF & "Press OK to EXIT ") IniWrite(@ScriptDir & "\path.ini", "Torun", "path", $path) IniWrite(@ScriptDir & "\path.ini", "Tokill", "pathk", $tokill) EndIf As you can see I manage to split the value returned by FileOpenDialog to have only the exe but as a noob I can't manage to get the path to copy the files I need to the same path.
Any idea? ^^