Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Dear Bert, This coding is very important to me. I have a few more data retrieval procedures. Please ask for help. 🙏
  3. Redundant alternations in the expression are useless. Try this one : $res = StringRegExp($str, '(*UCP)(?x) (?| ' & _ ' ([[:alpha:]]+)\h([A-Z][^,]+),\h? ' & _ ; names, Eds ' | ([[a-z\h.]+),\h? ' & _ ; et al ' | \((\d+)\)\.?\h? ' & _ ; year ' | ([A-Z][^.]+.\h) ' & _ ; ChapterTitle, PubLoc, Name ' | (\d+[\(\);.-]) ' & _ ; vol, issue, pages ' | (?:https?://)?(\w+\S+)$) ' , 3) ; url along with a little more restrictive condition here : While StringRegExp($res[$i], '^[A-Z]\S*$') ;<<<<<<<<< $s &= '<editor>' & '<givenNames>' & $res[$i] & '</givenNames>, ' & _ '<familyName>' & $res[$i+1] & '</familyName>' & '</editor>, ' & @crlf $i += 2 Wend
  4. AutoIt has the _WinAPI_ShowWindow function, which looks like it could easily be used to use ShowWindowAsync instead if needed by modifying the UDF.
  5. Today
  6. Maybe this. Untested but it looks like it would be way faster this way... Edit : tested and it works great on a few windows !
  7. You're using an older version of the Excel.au3 UDF, you should update AutoIt to the latest stable version instead of modifying the one you have.
  8. Because it doesn't work that way. The line you're running in the first example is a single line of code not in a script file. The second example won't run because it's looking for a file, not a line of code. Why don't you just stop thinking in this train of thought, and come up with another way of doing whatever it is you're trying to do. It won't work the way you want it to, and it's never going to be any clearer than that.
  9. GroupAdd is just an array or list of windows added to a group as far as I can tell from reading its description. It's faster because it's being run internally in AHK and you have to run it externally in AutoIt (externally meaning interpreted code). There's nothing similar in AutoIt. Feel free to open a tracker ticket to ask to have something similar added though.
  10. When using the code below #include <Array.au3> $winstuff =WinList("[CLASS:VTWin32]") for $loopme = 1 to ubound($winstuff) -1 WinSetState ( $winstuff[$loopme][0],"",@SW_MAXIMIZE) WinSetState ( $winstuff[$loopme][0],"",@SW_MINIMIZE) next It goes through each window found that matches the criteria and then does the maximize and minimize. So the process is extremely slow as it is doing one window at a time. I'm looking for a way to bulk maximize and minimize over 30 screen at the same time Hope that help explain it
  11. Sorry but i don't see this as the answer to the other question? You told me, that the sourcecode is included in the compiled .exe file, so why can't i just take the code from the ram and directly execute it with the Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Hello World!'', ''Hi!'')"') or Run(@AutoItExe & ' /AutoIt3ExecuteScript "MsgBox(4096, ''Hello World!'', ''Hi!'')"') Sorry if i'm the dumb person here, but i dont see an answer regarding to this question. This is no thread attempt and all the co process UDF's work like this, only that they are hardcoding this text - and i would like to create it more flexible. And sorry if you really did answer this question, as unfortunately I'm unable to recognise it. - "CreateThread" is not the question anymore, I'm now looking for another solution, thanks to your' explanations.
  12. This is my right of passage. I was not "Seeing" the error because I had been squeezing the log window down to a single line and all I saw was +>09:09:28 AutoIt3Wrapper Finished. Once I saw the error and posted it I also googled it and guess what.. DOH!!! Two little lines. Local $oWindow = $oExcel.Windows($oWorkbook.Name) ; <== Modified     If IsObj($oWindow) Then $oWindow.Visible = $bVisible ; <== Modified Made the update to excel.au3 and badda bing, we are off to the races. Thanks for showing an interest in my plight and thanks to each of you offering your help in your own special way.. It really did make me dig in want to learn how to perfect my own code..
  13. Hi All This is my first post to this forum, It is early days for me using Autoit as well so I guess I am asking pretty basic questions. Anyway I hope someone may be able to point me in the right direction. I tried the following: (However I am at a loss to determine how 5782 was found) If ProcessExists('MsWin.exe') Then If WinWait("[CLASS:MetaStockMainWnd]", "", 2) Then ; $hWin = WinGetHandle("[CLASS:MetaStockMainWnd]") ; ;ControlCommand("", "", "ToolbarWindow324", "SendCommandID", "5782") ControlCommand("", "", "ToolbarWindow324", "SendCommandID", "580") EndIf Else MsgBox(48, " Error", "Does not work") EndIf Sleep(3000) The code above is base on Atanik's post, it runs without error although Metastock did no show any response. That may be correct as the data I am using to feed the chart is static so a refresh would not show any change. I was hoping that using Ataniks example I could get to the all important "Hello world moment" for those that can remember GW basic way back it was always the first example. (These days I am Ok with Visual basic and Happy with MS Access VBA) However API coding I am not familiar with. A data service I have subscribed to is closing down and Autoit will be perfect to connect Metastock my existing program providing charting. Below is 2 screenshots of Metastock that shows the file menu and the window that opens when open (Using [ctrl]+O) is used As I understand it Autoit requires ^0 for this command Closing is just as simple Using ^C or ^E When manually driving metastock you do not even have to open a menu As long as the program has the focus as soon as it is opened hotkeys will work. [ctrl]+O will open the file dialogue with the code selection box already focussed The same applies to closing a chart ctrl+C or Ctrl+E (for more than one) will work without opening a menu. I have tried send() and ControlSend() but have not been able to get them working I can see the menu items using using inspection tools. The only interaction I need at this stage is being able to send those hotkey combinations to the Metastock program, Once this is working be able to call the scripts from VBA. with one parameter the stock code. I will work on that once the basics are done. I can see it is going to be a steep learning curve at the start and that there are several ways for Autoit to achieve the result. using mouse positions and clicks, opening combo boxes or using the available hot keys within metastock. All I need to do is display and replace charts. as selected in another program one at a time. Any suggestions would be most appreciated. Regards John See below 4 screenshot images plus a B&W image uploaded in error I cant delete.
  14. Yes, i did leave from the CreateThread, i got it know. My question is now another question, which i edited to my post: Or do the same thing just with the internal autoit run() command, but dont give it the entire "function" in clear text as a parameter - just give it the code from the memory as parameter, this would prevent the need of adding the code to each function you want to run   like for example: Run(@autoitexe & "\executescript " & _function_read_from_the_memory_by_pointer ) This way i could execute a function directly out of the script, if i create the function that way - that it acts like a "main" function if its not called with any arguments for example Would this work? - or is there any way to get the "function" text without having to hardcode it? Edit: and thank you for your patience and assistance.
  15. The answer to all of your questions have already been answered. A3X files are just the source code without the interpreter, just as if it would be inside the container .exe file without being able to be ran directly. What you want/need is to create a DLL and use that in both scripts, but they wouldn't be talking to each other even then. Read the answers given to you, and understand what you want isn't possible.
  16. Thank you, so that means - if i compile the sourcecode to an exe file, its basically the autoit3.exe interpreter* + the sourcecode, and if i call the compiled exe, it's starting the autoit3.exe which interpretes the sourcecode from top to bottom. is that correct? Edit: Would this also be the case for A3X files? Edit: could i run a CreateThread and Call a Run(not from autoit - like from user32.dll or whereever it is sitting) function, which then calls my script with \autoit3execute and give it the function code as argument? Or do the same thing just with the internal autoit run() command, but dont give it the entire "function" in clear text as a parameter - just give it the code from the memory as parameter, this would prevent the need of adding the code to each function you want to run like for example: Run(@autoitexe & "\executescript " & _function_read_from_the_memory_by_pointer ) This way i could execute a function directly out of the script, if i create the function that way - that it acts like a "main" function if its not called with any arguments for example
  17. Talking about a "loaded question" . It would help when you explain what exactly you want the code to do because referring to another language doesn't help much and I honestly do not understand what behaviour you want. Jos
  18. Once again, AutoIt is interpreted, period. Calling the xxx.exe output made by autoit3.exe a compiled program is kinda a fraud: it's merely an interpreter along with you code source text. There is no way to persuade the interpreter in progA to magically deroute itself towards some function source in the middle of progB. What you can do (beside copying common code in every prog needing it, which BTW is exactly what #include does) is implement IPC (inter process comm) between your programs to pass some arguments and politely ask the other side to perform function XYZ on that, then return a result. Your duty is to implement all the needed IPC for doing that. There are plenty of working IPC examples already posted. Of course, any IPC scheme is way slower and less secure than direct local code invokation.
  19. Then try and make up a script that works the same and shows the problem. Otherwise there's nothing we can do to help.
  20. Helllo, I'm currently converting a script fro Auto Hotkey over to Autoit. The script opens over 30 Windows for Unix Sessions. In AHK there is an option to group the screens together in a group and then execute the Maximize and Minimize in one pass ( users only sees one screen Maximize, then Minimize) AHk CODE GroupAdd("TeraTerm", WinTitle:="ahk_class VTWin32", WinText:="", ExcludeTitle:="", ExcludeText:="") WinMaximize(WinTitle:="ahk_group TeraTerm") WinMinimize(WinTitle:="ahk_group TeraTerm") When attempting to do this in AutoIT , the user sees each screen maximize and then minimize using the code below #include <Array.au3> $winstuff =WinList("[CLASS:VTWin32]") for $loopme = 1 to ubound($winstuff) -1 WinSetState ( $winstuff[$loopme][0],"",@SW_MAXIMIZE) WinSetState ( $winstuff[$loopme][0],"",@SW_MINIMIZE) next Is there a cleaner way to do this like it works in AHK ?
  21. What version of AutoIt and the Excel UDFs are you using? I don't have that line in my copy of the Excel.au3 file. BTW, I thought it ended with no errors?
  22. #Prohibit loading images prefs = { 'profile.default_content_setting_values': { 'images': 2, } } This will be left to be tested later. At present,i just want to learn some basic ones.
  23. "C:\Program Files (x86)\AutoIt3\Include\Excel.au3" (227) : ==> Variable must be of type "Object".: $oExcel.Windows($oWorkbook.Name).Visible = $bVisible $oExcel.Windows($oWorkbook.Name)^ ERROR ->08:18:12 AutoIt3.exe ended.rc:1 +>08:18:12 AutoIt3Wrapper Finished. >Exit code: 1 Time: 123.1 Above is the error I get around the 97th to 100 loop thru. It looks like there's something breaking in the Excel script. I excluded the whole row of the array that includes the tickers that the loop fails on so I eliminated the possibility of a bad invisible character. Also as I stated earlier, I can break the array down to 3 different arrays, cut and paste accordingly 50 elements in the first and second, 23 in the third run the script 3 times using the smaller arrays and it completes perfectly, every time. below is my loop. and I use the two includes at the top of my script. #include <Excel.au3> #include <Date.au3> for $x = 0 to 147 step 1 ;Start Array Loop splashtexton("Day_Tickers",$Tkr[$x]&" "&$x+1 & "-" & _NowTime(),200,50,3600,0) if stringinstr(FileReadline($csv_put&$Tkr[$x]&".csv",1),"timestamp") then ;Check for good file download ;****************************************************************** ;Open EXCEL Spreadsheets and cut and paste amd Save Global $EO= _Excel_Open() GLobal $WB1= _Excel_BookOpen($EO , $CSV_TEMPLATE ,True) Global $WB2= _Excel_BookOpen($EO, $csv_put &$Tkr[$x]&".csv",TRUE) Global $WB3= $CSV_SaveAs & $Tkr[$x] local $oRange = $WB2.ActiveSheet.Range("A1:F7") _excel_rangeCopyPaste($WB1.ActiveSheet, $oRange , "A1") _Excel_BookClose($WB2) _Excel_BookSaveAs($WB1,$WB3,$xlCSV, True) _Excel_BookClose($WB1) if stringinstr(FileReadline($CSV_SaveAs&$Tkr[$x]&".csv",2),"HIT") then ;Generate the HIT Files FileCopy($CSV_SaveAs&$Tkr[$x]&".csv", $Hits,1) ;Generate the HIT Files else endIF ;****************************************************************** Else FileWrite($No_Ticker&$Tkr[$x]&$NoTkr_Suffix," ") EndIf Next processclose("Excel.exe") EXIT
  1. Load more activity
  • Create New...