Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Thanks for this udf. Could you add an indeterminate state for checkbox ? I tried, but my gdi experience isn't very good.
  3. Today
  4. Agreed, he could easily annonimize his code as a small reproducing snippet, but if he just wants to spin his tires, so be it
  5. Good luck with that, might need WikiLeaks to get anything useful to work with.
  6. Reread your issues, and imagine you are one of us. Errors occur for a reason, and they are specific to something, but you have provided no details. What do you expect other than a comment like this asking for more info? Add a code snippet that we can run and reproduce the issue with.
  7. That's getting dangerously close to decompiling the script. The reason you can't call a function from memory in another script to yours is that the function has to exist in the first script or it won't be recognized, you can't create phantom functions in a script by pulling them in from elsewhere. The calling script has to know that the function exists, and has to know where in the script this function is, at runtime, so if it's not there when the script starts, the interpreter doesn't know about it.
  8. abhinav_sodha, That is exactly what I have done - as I said above. M23
  9. This UDF is only for AD and AAD. But have a look. Maybe you can see something in this UDF and create a new one like @water did.
  10. I have to write a multi-functional tool for my work, and on certrain button presses - different scripts have to run, but i don't want to use multiple exe files neither do i want to include the source code. This is not even about communicating between two scripts / which maybe in areas of the application should also be used - but for this i wanted to use the mailslot UDF. But i want a nice and clean way to start the already created functions, without the need of adding the functions i want to use in "clear text". The only thing which i still can't understand is: Why can my script run the memory part of my function, but cant be run by another script which copies exactly the same area of the memory into its own memory space (cause if I dont think completly wrong - it should be now the function of the other script) and then run it? Like where is the difference between memory space a and (after you copied the function from a to b) memoryspace b Or If i copy the function out of the memory - and save it into a file, what would be needed to actually make this code runable again, i dont want to be able to read it - it just should be runable by autoit itself. Like a stupid question now, if i compile my script X.au3 -> then inside of the X.exe will be an autoit.exe (/autoit64.exe) + the script - now the question is, into what is the script converted?
  11. Hi Jos, Thanks for moving it to the correct Forum. What I am looking for is: UDF that works with Azure Active Directory. If someone has built it, maybe they can share it, or AutoIT sample scripts that someone has built working with Azure Active Directory. Meanwhile, I'll continue looking for sample scripts.
  12. Okay, I suspect, that it's this combination: Start a Programm using Run() with the opt_flag $STDERR_MERGED killing this process When doing so, it doesn't matter whether StdioClose() is used or not, and in case it *IS* used, whether it's used before or after the ProcessClose($PID), the RAM consumption is increasing with each and every Run() used.
  13. Nice one! ok.. I have the most current version and that's when the trouble started. But, additional info... I just removed #include<date.au3> from the mix and that seems to have alleviated the issue. I am testing now.. I didn't use ubound() but I did change the 147 to a variable. and my ultimate plan is to use an external file to populate an array. So I don't have to worry about listing elements IN the script.
  14. I think I've caught the problem: It happens, when I use Run() with $STDERR_MERGED to catch the Output. This script is demonstrating the situation. Press F12 to toggle between using and not using $STDERR_MERGED ; *** Start added by AutoIt3Wrapper *** #include <AutoItConstants.au3> ; *** End added by AutoIt3Wrapper *** #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Misc.au3> $loops = 0 $CleanupRAM = False $aWS = ProcessGetStats() $WSram = $aWS[0] $WSramPeak = $aWS[1] $xMax=9999 $yMax=99 Dim $aTest[$xMax+1][$yMax+1] AdlibRegister(UpdToolTip) $PID=False $GrabOutput=False While 1 if _IsPressed("7B") Then if $GrabOutput=False Then $GrabOutput=True else $GrabOutput=False EndIf Sleep(100) EndIf $RandX=Random(0,$xMax,1) $RandY=Random(0,$yMax,1) $aTest[$RandX][$RandY]=$RandX * $RandY * Random(1,100) if ProcessExists($PID) then ProcessClose($PID) if $GrabOutput Then $PID=Run(@ComSpec & " /c echo hello",@TempDir,@SW_HIDE, $STDERR_MERGED) Else $PID=Run(@ComSpec & " /c echo hello",@TempDir,@SW_HIDE) EndIf $loops+=1 WEnd Func UpdToolTip() $sResult = "Loops: " & $loops & @CRLF $aWS = ProcessGetStats() $WS_TXT = " WorkingSetSize (4k)= " & Round($aWS[0] / 1024 / 4, 2) & @CRLF & "PeakWorkingSetSize (4k)= " & Round($aWS[1] / 1024 / 4, 2) & @CRLF & _ "RAM Delta 4k pages : " & Round(($aWS[0] - $WSram) / 1024 / 4, 2) & @CRLF & _ "Peak Delta 4k pages : " & Round(($aWS[1] - $WSramPeak) / 1024 / 4, 2) If $CleanupRAM Then DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) $aWS = ProcessGetStats() $WS_TXT &= @CRLF & _ "RAM Delta (after cleanup) = " & Round(($aWS[0] - $WSram) / 1024 / 4, 2) & @CRLF & _ "Peak Delta (after cleanup) = " & Round(($aWS[1] - $WSramPeak) / 1024 / 4, 2) EndIf $WSram = $aWS[0] $WSramPeak = $aWS[1] if $GrabOutput Then ToolTip($WS_TXT & @CRLF & $sResult & @CRLF & "With $STDERR_MERGED", 500, 100, "Random Array Fill, loops: " & $loops) Else ToolTip($WS_TXT & @CRLF & $sResult & @CRLF & "Without $STDERR_MERGED", 500, 100, "Random Array Fill, loops: " & $loops) EndIf EndFunc ;==>UpdToolTip Helpfile for Run(): $STDERR_MERGED (0x8) = Provides the same handle for STDOUT and STDERR. Implies both $STDOUT_CHILD and $STDERR_CHILD. Shot in the dark: This handle is not destroyed automatically. Howto do that explicitely? Maybe StdioClose() , on my way to try that one.
  15. @Melba23 <cite> ... using that particular line of code merely pushes a little more of the less-often-used pages in RAM onto a Windows file on the harddisk </cite> Hm. That means the RAM not freed correctly for some reason is just swapped to disk, if I get you correctly? (I missed that aspect before) To the Windows swap file, or to some dedicated "Swap-file-for-this-app"? Hm. Then this is definitely no option, as spoiling disk space, especially the Windows PAGEFILE.SYS to free RAM is not a good idea. Can you see in the sample scripts how to avoid the continuosly growing RAM consumption? TIA Rudi.
  16. I have two comments on what I have seen Is this the most current version of AutoIt? Your For loop counter is problematic. Please see the Ubound() function? Hardcoding the For like that to 147 items is bound to cause problems. Punned it
  17. OK, if anybody's still looking, The script ran perfectly AFTER I did the 2 line "Fix" for excel.au3 BUT after I upgraded, After the 2nd run, every time the script hits element 118 in the array, the autoit executable gets a win32 exception. Even if i run it 64 bit. I've already turned the debugger off in internet options, deleted the registry items mentioned on various sites. I have also changed the DEP setting in computer properties to be for windows programs and services only. Is there something else I'm missing?
  18. Look at my posts in this topic Soluton is to use Winspector to identify CommandID and in AutoIt use _SendMessage() + WM_COMMAND + this CommandID as wparam
  19. Possible but then how do you pass arguments? And how is that simpler or more efficient than just put your function in an #include file? Once again (sigh!) NO. The only sensible way beside #include is IPC but I hardly see that necessary in the use case. Perhaps instead of an XY problem you could expose why on earth you insist on not using #include. Is that because you persist to try multithreading? If yes, then best of luck. Remember that threads are (still today) evil. No multithreaded program can be formally proven correct, which speaks volume about the [lack of] robustness of the paradigm! It actually is.
  20. It's correct. But if you want the whole thing to work in both cases, this must be mentioned in the expression by putting 2 alternations #Include <Array.au3> Local $astr[1] = ["Wagner W., Raudsepp M., Holtz P., Sen R., (2017) Essence politics Identity work and stereotyping in inter-group relations. Haward C., Matt C., The social psychology of everyday politics. London. Routledge. 121-150."] ; Local $astr[1] = ["Wagner, W., Raudsepp, M., Holtz, P., Sen, R., (2017) Essence politics Identity work and stereotyping in inter-group relations. Haward, C., Matt, C., The social psychology of everyday politics. London. Routledge. 121-150."] $n = 0 For $str In $astr $res = StringRegExp($str, '(*UCP)(?x) (?| ' & _ ' ([A-Za-z]+)\h([A-Z][^,]+),\h? ' & _ ; names, Eds , case #1 ' | ([A-Za-z][^.]+),\h([A-Z][^,]+),\h? ' & _ ; names, Eds , case #2 ' | ([[a-z\h.]+),\h? ' & _ ; et al ' | \((\d+)\)\.?\h? ' & _ ; year ' | ([A-Z][^.]+\.\h) ' & _ ; ChapterTitle, PubLoc, Name ' | (\d+[\(\);.-]) ' & _ ; vol, issue, pages ' | (?:https?://)?(\w+\S+)$) ' , 3) ; url $n += 1 _ArrayDisplay($res, $n) Local $i = 0, $s = '<File xml:id="1110">' & @crlf & _ '<citation type="journal" xml:id="00001">' & @crlf While $i < UBound($res) AND StringRegExp($res[$i], '^[A-Z]') $s &= '<Person>' & '<familyName>' & $res[$i] & '</familyName>, ' & _ '<givenNames>' & $res[$i+1] & '</givenNames>' & '</Person>, ' & @crlf $i += 2 Wend If $i < UBound($res) AND StringRegExp($res[$i], '^[a-z\h.]+$') Then $s &= $res[$i] & @crlf $i += 1 EndIf If $i < UBound($res) AND StringIsDigit($res[$i]) Then $s &= '(<pubYear year="' & $res[$i] & '">' & $res[$i] & '</pubYear>);' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringIsUpper(StringLeft($res[$i], 1)) Then $s &= '<chapterTitle>' & $res[$i] & '</chapterTitle>. ' & @crlf $i += 1 EndIf While $i < UBound($res) AND StringRegExp($res[$i], '^[A-Z]\S*$') $s &= '<editor>' & '<givenNames>' & $res[$i] & '</givenNames>, ' & _ '<familyName>' & $res[$i+1] & '</familyName>' & '</editor>, ' & @crlf $i += 2 Wend If $i < UBound($res) AND StringIsUpper(StringLeft($res[$i], 1)) Then $s &= '<OtherTitle>' & $res[$i] & '</OtherTitle>. ' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringIsUpper(StringLeft($res[$i], 1)) Then $s &= '<Location>' & $res[$i] & '</Location>. ' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringIsUpper(StringLeft($res[$i], 1)) Then $s &= '<LocationName>' & $res[$i] & '</LocationName>. ' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringRegExp($res[$i], '^\d+-$') Then $s &= '<pageFirst>' & StringTrimRight($res[$i], 1) & '</pageFirst>' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringRegExp($res[$i], '^\d+\.$') Then $s &= '?<pageLast>' & StringTrimRight($res[$i], 1) & '</pageLast>.' & @crlf $i += 1 EndIf If $i < UBound($res) AND StringInStr($res[$i], "doi") > 0 Then $s &= '<url href="' & $res[$i] & '">' & $res[$i] & '</url>' & @crlf $i += 1 ElseIf $i < UBound($res) AND StringInStr($res[$i], "www") > 0 Then $s &= '<url href="' & $res[$i] & '">' & $res[$i] & '</url>' & @crlf $i += 1 ElseIf $i < UBound($res) AND StringInStr($res[$i], "http") > 0 Then $s &= '<url href="' & $res[$i] & '">' & $res[$i] & '</url>' & @crlf $i += 1 EndIf $s &= '</citation>' & @crlf $s &= '</File>' & @crlf Msgbox(0, $n, $s) Next
  21. Yes, i got nearly all of those files here - but nothing of those is realy what i would like. The new idea would be somehow like this: Local $l = @ScriptDir & "\tmp_call.au3", $r, $e, $a      Dim $CallBack = DllCallbackRegister("_CallMeFunction", "int", "int;int;int;bool") ; i want the address of  the autoit function     ConsoleWrite( "!$CallBack:        "& $CallBack & @CRLF )     $a = DllCallbackGetPtr($CallBack)     ConsoleWrite( "!DllCallbackGetPtr:    "& $a & @CRLF )  ; i got the address of  the autoit function ; here should be a part which "extract" runnable autoit code from the memory / i would also map the code into the memory/ if possible - but i want to avoid creating a function like: #cs     $test_string = 'Func _CallMeFunction( $a=1, $b=2, $c=3, $externalCall=False )' & @CRLF & _                     'If ($externalCall = True) Then' & @CRLF & _                         'MsgBox(0, "external", "call - running in its own script " & $a & $b & $c  )' & @CRLF & _                     'ElseIf ($externalCall = False) Then' & @CRLF & _                         'MsgBox(0, "internal", "call - running in the main script " & $a & $b & $c  )' & @CRLF & _                     'EndIf' & @CRLF & _                     'Return 1' & @CRLF & _                     'EndFunc' & @CRLF & _                     '_CallMeFunction()'   and preferable be able to just to something like this : #ce    $r = _ExtractAutoItCodeFromMemory( $a, '_CallMeFunction', $lenght )     FileWrite( $l , $r )     $e = Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $l & '"' )     ConsoleWrite( "!Run:            "& $e & @CRLF )     MsgBox(0, $e, $a )     Exit   Func _CallMeFunction( $a=1, $b=2, $c=3, $externalCall=True )     If $externalCall = True Then         MsgBox(0, "external", "call - running in its own script " & $a & $b & $c  )     ElseIf $externalCall = False Then         MsgBox(0, "internal", "call - running in the main script " & $a & $b & $c  )     EndIf     Return 1 EndFunc i hope this is understandable - if this is also not possible, okay - then im going to look for another solution, got some more freaky ideas in mind.
  22. Hotkeys can only be assigned to one task. If another task has already set the hotkey, hotkeyset () sets @error. This is the case here. Some programs only set the hotkeys when they are in the foreground and delete them when they are in the background. So always check the return code of hotkeyset(). Here is a small example: _Hotkeyset("#d","_Hotkeys") ; is reserved by windows to hide/show desktop _Hotkeyset("x","_Hotkeys") ; is not defind as CASE. Try it. _Hotkeyset("{F2}","_Hotkeys") ; display a message _Hotkeyset("{F3}","_Hotkeys") ; exit script While Sleep(1000) WEnd Func _Hotkeyset($Key, $Func) If HotKeySet($Key, $Func) = 0 Then Return MsgBox(64+262144, " Hotkeyset Error", "Hotkey " & $Key & " already set by another task.", 0) EndFunc ;==>_Hotkeyset Func _Hotkeys() Switch @HotKeyPressed Case "{F2}" MsgBox(64+262144, Default, "You pressed F2",2) Case "{F3}" Exit MsgBox(64+262144, Default, "Bye, Bye",2) Case "#d}" MsgBox(64+262144, Default, "WIN+D will never match.",0) Case Else MsgBox(64+262144, Default, "Hotkey: " & @HotKeyPressed & " is not defined as CASE.", 0) EndSwitch EndFunc ;==>_Hotkeys
  23. roeselpi, You are not redisplaying the GUIs - you are recreating them each time, which is why you get the original values each time you "redisplay" the main GUI. Plus I am pretty sure you are getting into some serious recursion with all those calls - which usually ends in tears. You need to do something like this: #include <GUIConstantsEx.au3> ; Create main GUI $Form1 = GUICreate("Form1", 203, 137, -1, -1) $MenuItem2 = GUICtrlCreateMenu("MenuItem2") $MenuItem1 = GUICtrlCreateMenuItem("MenuItem1", $MenuItem2) $Edit1 = GUICtrlCreateEdit("", 24, 32, 161, 57) GUICtrlSetData(-1, "Edit1") GUISetState(@SW_SHOW) ; Create and hide dialog $Form2 = GUICreate("Form2", 365, 136, -1, -1) $Combo1 = GUICtrlCreateCombo("Combo1", 32, 24, 297, 25) $Button1 = GUICtrlCreateButton("Button1", 32, 88, 75, 25) $Button2 = GUICtrlCreateButton("Button2", 256, 88, 75, 25) GUISetState(@SW_HIDE) ; Now do everything in your idle loop While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $Form1 Switch $aMsg[0] Case $GUI_EVENT_CLOSE ; Exit the whole script Exit Case $MenuItem1 ; Disable main GUI and show dialog GUISetState($Form1, $GUI_DISABLE) GUISetState(@SW_SHOW, $Form2) EndSwitch Case $Form2 Switch $aMsg[0] Case $GUI_EVENT_CLOSE ; Hide dialog and reenable main GUI GUISetState(@SW_HIDE, $Form2) GUISetState($Form1, $GUI_ENABLE) EndSwitch EndSwitch WEnd No functions, no recursive calls - and the same GUIs are used each time. Please ask if you have any questions. M23
  24. I want to use python scripting in AutoIT. Whether this is possible. When see some forum I can see PyautoIT ehich is Python binding for AutoItX3.dll. Using this whether we can write Python scripting in AutoIt?
  1. Load more activity
×
×
  • Create New...