glasglow Posted May 13, 2008 Share Posted May 13, 2008 I am using one main .Au3 program and have another complete program in another .Au3 and don't want to put them together physically but want to be able to use the main.au3 to call the second and third. Usually I would use the GUICtrlSetOnEvent to call a function. Can I use the GUICtrlSetOnEvent to call another .au3 script? Like replace the code below "_function" with "second.au3" even though that won't work.. something like it? I could make the second.au3 and third.au3 a function but the problem is each one has it's own internal functions and make the dominant script a function doesn't allow calling it's secondary functions. #include <second.au3> #include <third.au3> $filemenu = GUICtrlCreateMenu ("&File") $fileitem = GUICtrlCreateMenuitem ("Close",$filemenu) GUICtrlSetOnEvent($fileitem, "_Function") Func _function() Code here Endfunc Link to comment Share on other sites More sharing options...
ChrisL Posted May 13, 2008 Share Posted May 13, 2008 Like this... _launchScript() returns the PID of the instance of the external running script _launchScript(@scriptdir & "\second.au3") _launchScript(@scriptdir & "\Third.au3") Func _launchScript($vScript, $vWorkingDir = @ScriptDir) If NOT FileExists($vScript) then Return -1 If @compiled then Return Run(FileGetShortName(@ScriptFullPath) & " /AutoIt3ExecuteScript " & FileGetShortName($vScript) , $vWorkingDir) Else Return Run (FileGetShortName(@AutoItExe) & " /AutoIt3ExecuteScript " & FileGetShortName($vScript) , $vWorkingDir) EndIf EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
glasglow Posted May 13, 2008 Author Share Posted May 13, 2008 Like this... _launchScript() returns the PID of the instance of the external running script _launchScript(@scriptdir & "\second.au3") _launchScript(@scriptdir & "\Third.au3") Func _launchScript($vScript, $vWorkingDir = @ScriptDir) If NOT FileExists($vScript) then Return -1 If @compiled then Return Run(FileGetShortName(@ScriptFullPath) & " /AutoIt3ExecuteScript " & FileGetShortName($vScript) , $vWorkingDir) Else Return Run (FileGetShortName(@AutoItExe) & " /AutoIt3ExecuteScript " & FileGetShortName($vScript) , $vWorkingDir) EndIf EndFunc Thank you very much. I was going on the right track with run but the FileGetShortName wasn't even considered. Thank you again. A good study. Link to comment Share on other sites More sharing options...
ChrisL Posted May 13, 2008 Share Posted May 13, 2008 Thank you very much. I was going on the right track with run but the FileGetShortName wasn't even considered. Thank you again. A good study.FileGetShortName() just gets round issues with long file paths with spaces in [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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