nill Posted June 16, 2023 Share Posted June 16, 2023 (edited) 1) I need the autoit script to periodically run another autoit script through VS Code to see all the logs, how to do it ? 2) If it is possible to do this, will all logs in console OUTPUT saved in VS Code or I will see only the last attempt to run? Edited June 16, 2023 by nill Link to comment Share on other sites More sharing options...
argumentum Posted June 16, 2023 Share Posted June 16, 2023 so, what is VS code ? What have you've got ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 16, 2023 Moderators Share Posted June 16, 2023 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
20Ice18 Posted June 16, 2023 Share Posted June 16, 2023 Install the "Code Runner" extension in VS Code that allows you to run code snippets or scripts within VS Code itself. Create a new AutoIt script file (for example main.au3) that will act as the entry point for running your desired script. In main.au3, use the Run function from AutoIt to execute your target AutoIt script. For example: Run("path\to\your\script.au3") Replace "path\to\your\script.au3" with the actual path to your target AutoIt script. Save main.au3 and open it in VS Code. Use the keyboard shortcut Ctrl + Alt + N (or go to Code -> Run Code from the VS Code menu) to run main.au3. The console output of your target script will be displayed in the "OUTPUT" tab in VS Code. You will be able to see the logs as the script runs. Regarding your second question, by default, the console OUTPUT in VS Code will display the output of the current script run. If you run the script again, the previous output will be replaced by the new output. To view all logs from multiple runs, you may need to modify your script to write the logs to a file or append them to an existing log file Also effectiveness of logging depends on how your target AutoIt script handles logging internally. ❤️ Link to comment Share on other sites More sharing options...
nill Posted June 17, 2023 Author Share Posted June 17, 2023 (edited) On 6/16/2023 at 2:02 PM, 20Ice18 said: Install the "Code Runner" extension in VS Code After installing and creating Main_backup.au3, I try to run any autoit script press Ctrl + Alt + N writes me [Running] autoit3 "c:\Autoit_code\Main_backup.au3" "autoit3" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���. [Done] exited with code=1 in 0.179 seconds my code was ConsoleWrite("$kk=" @CRLF) $kk=Run("NEW_BD_backup.au3") ConsoleWrite("$kk=" & $kk & @CRLF) Main_backup.au3 and NEW_BD_backup.au3 in the same directory the file NEW_BD_backup.au3 definitely does not start it creates new files in the folder, and they are not there Edited June 17, 2023 by nill Link to comment Share on other sites More sharing options...
Developers Jos Posted June 17, 2023 Developers Share Posted June 17, 2023 The Run() command requirs an Windows executable, not a readable script! So you either include the script at the place you like it performed or you need to run AutoIt3.exe with the script as input. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
nill Posted June 17, 2023 Author Share Posted June 17, 2023 1 hour ago, Jos said: The Run() command requirs an Windows executable, not a readable script! So you either include the script at the place you like it performed or you need to run AutoIt3.exe with the script as input. Please give an example of launching what you are talking about ? Link to comment Share on other sites More sharing options...
ioa747 Posted June 17, 2023 Share Posted June 17, 2023 ConsoleWrite("$kk=" & @CRLF) ;~ $kk = Run("NEW_BD_backup.au3") $kk = Run(FileGetShortName(@AutoItExe) & " /AutoIt3ExecuteScript " & FileGetShortName("full\path\of\NEW_BD_backup.au3")) ConsoleWrite("$kk=" & $kk & @CRLF) Hashim 1 I know that I know nothing Link to comment Share on other sites More sharing options...
nill Posted June 17, 2023 Author Share Posted June 17, 2023 (edited) 11 minutes ago, ioa747 said: ConsoleWrite("$kk=" & @CRLF) ;~ $kk = Run("NEW_BD_backup.au3") $kk = Run(FileGetShortName(@AutoItExe) & " /AutoIt3ExecuteScript " & FileGetShortName("full\path\of\NEW_BD_backup.au3")) ConsoleWrite("$kk=" & $kk & @CRLF) it works! but I cant see the log in output console for NEW_BD_backup.au3 I see only this Quote #85: Starting process #85 "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "c:\Autoit_code\Main_backup.au3" [PID 5552] +>17:57:55 Starting AutoIt3Wrapper (21.316.1639.1) from:Code.exe (1.78.2.0) Keyboard:00000409 OS:WIN_11/2009 CPU:X64 OS:X64 Environment(Language:0419) >Running AU3Check (3.3.16.1) from:C:\Program Files (x86)\AutoIt3 input:c:\Autoit_code\Main_backup.au3 +>17:57:55 AU3Check ended.rc:0 >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "c:\Autoit_code\Main_backup.au3" /errorstdout +>Setting Hotkeys...--> Press Ctrl+Alt+Pausebreak to Restart or Ctrl+Pausebreak to Stop. $kk= $kk=7424 +>17:57:56 AutoIt3.exe ended.rc:0 +>17:57:56 AutoIt3Wrapper Finished. >>Exit code 0 Time: 1.184 Edited June 17, 2023 by nill Link to comment Share on other sites More sharing options...
Developers Jos Posted June 17, 2023 Developers Share Posted June 17, 2023 Ofcourse as it shells a total different program and you aren't checking for its STDOUT/STDERR and not waiting for it to finish! Open the helpfile and look for STDOUTREAD() and look at the examples shown. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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