CYCho Posted April 27, 2019 Posted April 27, 2019 Maybe I didn't search enough of this forum, but I couldn't find anything like Interactive AutoIt Command Window. I miss the Command Window of Visual FoxPro and I feel sorry that VFP was fossilized without unicode support. What do I do to copy xxx.exe to yyy.exe in the same folder for example? I would use Power Shell, or I would copy it to another folder, change the name there and move it back to the original folder. Or I would write a samll AuotoIt script including FileCopy() function and run the script. If I have VFP running in my computer, I would simply issue 'copy file xxx.exe to yyy.exe' command in the Command Window. Now I have the following script which works like VFP Command Window but with very limited functionality. Is there a UDF already written for this purpose that I couldn't find? #include <Inet.au3> #include <Misc.au3> #include <File.au3> #include <Array.au3> HotKeySet("^!z", "MyExit") HotKeySet("^!c", "MyCommand") Local $a1, $a2, $a3, $s1, $s2, $s3 While 1 Sleep(20) WEnd Func MyCommand() Local $var = InputBox("Interactive AutoIt", "Enter an AutoIt command.", "", "", 300, 130) If @error Or $var = "" Then Return EndIf Local $answer = Execute($var) MsgBox(0, "Interactive AutoIt", 'The value is: "' & $answer & '" ') EndFunc Func MyExit() Exit EndFunc zPlayer - A Small Audio and Video Player
mikell Posted April 27, 2019 Posted April 27, 2019 3 hours ago, CYCho said: What do I do to copy xxx.exe to yyy.exe in the same folder for example? Using your script, if I write in the inputbox : FileCopy("xxx.exe", "yyy.exe") , it works nice for me It should work for many instructions, provided that these instructions are one-liners
CYCho Posted April 27, 2019 Author Posted April 27, 2019 We can use this for some of 2 line commands: First you enter Assign("a1", _FileListToArray(@ScriptDir, "*")) Then you enter _ArrayDisplay($a1) zPlayer - A Small Audio and Video Player
mikell Posted April 27, 2019 Posted April 27, 2019 This single command works for me _ArrayDisplay(_FileListToArray(@ScriptDir, "*")) IMHO this kind of command window should not be intended to deal with variables CYCho 1
CYCho Posted April 27, 2019 Author Posted April 27, 2019 @mikell Thanks for your comments. If we use editbox instead of inputbox, maybe we can make it execute multi-line commands. zPlayer - A Small Audio and Video Player
Nine Posted April 27, 2019 Posted April 27, 2019 1 hour ago, CYCho said: If we use editbox instead of inputbox, maybe we can make it execute multi-line commands. Execute will only work with a single line instruction. One possible solution, you would need to execute one line after the other. Or save the whole editbox to a file.au3 then run it as a script like this : FileWrite ("Test.au3",$var) $answer = RunWait ("AutoIt3.exe Test.au3","") FileDelete ("Test.au3") “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
RTFC Posted April 27, 2019 Posted April 27, 2019 14 minutes ago, Nine said: Execute will only work with a single line instruction. @Nine: Wrong. @CYCho: example My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
mikell Posted April 27, 2019 Posted April 27, 2019 13 minutes ago, Nine said: Or save the whole editbox to a file.au3 then run it as a script Possible but tricky. Caution with non-declared variables, #includes if non-integrated funcs are used, unusable results, and so on
mikell Posted April 27, 2019 Posted April 27, 2019 @Nine This works for me #Include <Array.au3> Local $a = [1, 2, 3] Execute('Msgbox(0,"", $a[2]) @crlf _ArrayDisplay($a)')
Nine Posted April 27, 2019 Posted April 27, 2019 2 minutes ago, mikell said: @Nine This works for me #Include <Array.au3> Local $a = [1, 2, 3] Execute('Msgbox(0,"", $a[2]) @crlf _ArrayDisplay($a)') LoL, ya my bad I was still running my runwait thing “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
CYCho Posted April 27, 2019 Author Posted April 27, 2019 Thank you @RTFC. You pointed me to some posts which are very interesting. Somehow these posts escaped my search. zPlayer - A Small Audio and Video Player
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now