
techsray
Members-
Posts
8 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by techsray
-
Create Documentation for AutoIT scripts
techsray replied to witty's topic in AutoIt General Help and Support
AutoIt Documentation Generation using Sphinx and Pygments Is it possible to use the python Sphinx documentation generator library (which uses Pygments for code-highlighting) to generate documentation from .au3 files? If this could be done, then people can easily share there code on GitHub/GitLab/BitBucket and the generated documentation as well. In addition to this, they will be able to share the generated docs on readthedocs.io for free. They can also use a CI pipeline for the documentation generation. I think the better the documentation the more will be the adoption. Selecting default highligh_language in sphinx: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-highlight_language Pygments supports AutoIt code-formatting: https://pygments.org/ Sphinx has support for code-documentation in languages other than python: https://www.sphinx-doc.org/en/master/ Here is an example of documentation-generation for non-python code (C++). However they used "doxygen" to extract C++ API documentation. According to this article, "Sphinx doesn’t have the ability to extract API documentation from C++ headers" -- this I am not sure about. https://devblogs.microsoft.com/cppblog/clear-functional-c-documentation-with-sphinx-breathe-doxygen-cmake/ Example of AutoIt code-formatting using Pygments (Can be used in LaTeX. Sphinx uses Pygments). See Demo here. -
I figured it out. The scripts will work with a small modification at the top. You need to comment out "#NoAutoIt3Execute" from each of the scripts and replace it by the following. ;#NoAutoIt3Execute ; Refer to this forum post for the following change: ; https://www.autoitscript.com/forum/topic/161004-autoit-v33102-runautoitexe-autoit3executeline-issue/?do=findComment&comment=1168605 #pragma compile(AutoItExecuteAllowed, true) The fix mentioned above is necessary and in accordance with the "Change Log": I tested one of the Utility Functions from CommUtilities.au3 and it ran perfectly. After you have made the change, try the following: #include <CommUtilities.au3> Local $sCommPorts = _CommAPI_GetCOMPorts() ConsoleWrite("COM Ports:" & @LF & $sCommPorts & @LF) I hope this helps. The scripts were copied from here: https://www.autoitscript.com/wiki/CommAPI and then corrected.
- 116 replies
-
- COM portserial port
- RS-232
-
(and 4 more)
Tagged with:
-
I wrote a function that comprehends all the working solutions mentioned earlier in this thread: #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> ; Call Function: f_RunAsAdmin_CMD f_RunAsAdmin_CMD(0,1,@SW_SHOW) ; Define Function: f_RunAsAdmin_CMD Func f_RunAsAdmin_CMD($iMethod = 0, $iDebugFlag = 0, $sShowFlag = @SW_SHOW) ; This function returns an administrator CMD window based on the method chosen: ; $iMethod = 0 : use ShellExecute with RunAs ; $iMethod = 1 : use #RequireAdmin and Run("cmd") ; $iMethod = 0 is Default Option ; ; Include: Add the following two lines at the top of your script ; #include <MsgBoxConstants.au3> ; #include <AutoItConstants.au3> Local $sMessage = "Window State: " If Not($iMethod = 1) Then $iMethod = 0 ; Default method EndIf Switch $sShowFlag Case @SW_SHOW $sMessage &= "Visible" Case @SW_HIDE $sMessage &= "Hidden" Case @SW_MINIMIZE $sMessage &= "Minimized" Case @SW_MAXIMIZE $sMessage &= "Maximized" Case Else ; Default $sShowFlag = @SW_SHOW $sMessage &= "Visible" EndSwitch If ($iDebugFlag = 1) Then ConsoleWrite("Method Used: " & String($iMethod) & @LF & $sMessage & @LF) MsgBox(0,"Run CMD as Admin","Method Used: " & String($iMethod) & @LF & $sMessage ,1) EndIf If ($iMethod = 0) Then ShellExecute(@ComSpec, "", "", "RunAs",$sShowFlag) Else #RequireAdmin Run("cmd","",$sShowFlag) EndIf EndFunc I hope this will be helpful for future discussions. You could also consider using RunAsWait (replace RunAs) and ShellExecuteWait (replace ShellExecute) to wait until the CMD window is launched and finishes spawning. example_RunAsAdmin_CMD.au3
- 7 replies
-
- cmd
- sapien.activitexposhv3
-
(and 1 more)
Tagged with:
-
@junkew Thank you for your help. I will try this and update if I get this to work.
- 7 replies
-
- video grab
- autoit gui
- (and 2 more)
-
@iamtheky The software is OPUS from Bruker and the video feed is from a microscope (an not over any URL: as far as I know currently). The computer that this software runs on is completely separated from outside network.
- 7 replies
-
- video grab
- autoit gui
- (and 2 more)
-
@FrancescoDiMuro There is this software that captures the video feed from a microscope. I intend to grab that and along with some other enhancements recast that feed into a GUI designed by me. Basically, this will allow my research team to make some changes to the microscope parameters and see the changes live right next to the controls that were used to do those changes. I do not know if this explains your question. Than you for taking interest and initiative in helping me out here. Please let me know if you need to know anything else.
- 7 replies
-
- video grab
- autoit gui
- (and 2 more)
-
Hello, I am quite sure that I must be doing something wrong while using this UDF. Every time I ran the code (Example-1: https://www.autoitscript.com/wiki/CommAPI_Examples) I got the following error. Any suggestion in figuring out what I am doing wrong will be very helpful. Here is the example that I am trying to run: Example-1: test_CommAPI_Example2.au3 The CommAPI Files that I am using are: 1. CommInterface.au3 2. CommUtilities.au3 3. CommAPIHelper.au3 4. CommAPI.au3 5. CommAPIConstants.au3 6. CommObsolete.au3 Here is my System Information: Autoit version: 3.3.14.2 Architecture type: X64 Opreating System build number: 9600 Service pack info: Opreating System Type: WIN32_NT Oprating System Version: WIN_81 I used the following function to generate this: f_ShowSystemInfo(1) Func f_ShowSystemInfo($iShowMessageBoxFlag = 1) Local $sInfo = " Autoit version: " & @AutoItVersion & @LF & _ " Architecture type: " & @OSArch & @LF & _ " Opreating System build number: " & @OSBuild & @LF & _ " Service pack info: " & @OSServicePack & @LF & _ " Opreating System Type: " & @OSType & @LF & _ " Oprating System Version: " & @OSVersion & @LF ConsoleWrite("System Info" & @LF & $sInfo & @LF) If ($iShowMessageBoxFlag = 1) Then MsgBox(0,"Version Info", $sInfo) EndIf EndFunc
- 116 replies
-
- COM portserial port
- RS-232
-
(and 4 more)
Tagged with:
-
Hello All, I am trying to capture a video feed from a window in a software and then recast that in another GUI designed using AutoIt. What would be the best strategy to approach this? Thank you
- 7 replies
-
- video grab
- autoit gui
- (and 2 more)