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? ^^
I'm working on this script:
Case $BTN Global $URL = FileOpenDialog("IMPORT FILE", $DESKTOP, "ALL FORMAT (*)", 4) $DIR_DEST = "C:\DIR-WORK\list\IMPORT_DOC\" DirCreate($DIR_DEST) Local $LINE For $t = 1 To $URL _FileReadToArray($URL[$t], $LINE) For $u = 1 To $LINE FileCopy($URL[$u], $DIR_DEST) Next Next the selected files via OpenFileDialog must be copied to the folder $DIR_DEST.
Why if I select only one file the array doesn't return the path?? And 4 multiple files return the row PATH? There is a mode to have in the same case signle or multiple selection the path included in the file name? THX
#include <Array.au3> #include <File.au3> Local $spFile $mFile = FileOpenDialog("apri", @ScriptDir & "", "Images (*.iso)", 1 + 4 ) If @error Then ConsoleWrite("error") Else $spFile = StringSplit($mFile, "|") EndIf _ArrayDisplay($spFile)
There is something weird with FileSaveDialog. It takes approximately 8 seconds on my computer to return after clicking on OK.
When compiling this exact code it looks faster but I still have this slow behaviour on another compiled software (LinuxLive USB Creator).
$DEBUG_TIMER=TimerInit() $source_file = FileOpenDialog("Please choose an ISO image of LinuxLive CD", "", "ISO / IMG / ZIP (*.iso;*.img;*.zip)", 1,"") ConsoleWrite("It took "&Round(TimerDiff($DEBUG_TIMER)/1000,1)&" seconds to select ISO") Do you know what could cause this ?
Thank you for your help
PS : I'm still looking for AutoIT devs to help me on LinuxLive USB Creator. If interested, please contact me.
I dont know what am I doing wrong, I want to run a .m file in the directory of my script its name is Matlabcode.m
Run(@ScriptDir & "\Matlabcode.m", "", @SW_MAXIMIZE)