gcue Posted July 29, 2010 Share Posted July 29, 2010 i have a custom function _CopyWithProgress (made by SumTingWong which works great! by the way) which i would like to use AutoIt3ExecuteLine with. I think i have the quotations correct but the error i get is "Unknown function name" so im wondering if we can use AutoIt3ExecuteLine with custom functions. has anyone been able to? Run(@AutoItExe & ' /AutoIt3ExecuteLine "_CopyWithProgress(''' & $path_name & ''', ''' & $source_path & ''', ''' & $target_path & ''')"') thanks Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 29, 2010 Share Posted July 29, 2010 Hi, why not using something like this? If @Compiled Then Run('"' & @AutoItExe & '" ' & @AutoItPID) Else Run('"' & @AutoItExe & '" ' & '/AutoIt3ExecuteScript "' & @ScriptFullPath & '" ' & @AutoItPID, '', @SW_HIDE) EndIf Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
gcue Posted July 29, 2010 Author Share Posted July 29, 2010 interesting idea... but didnt work for me =/ when i use the _copywithprogress function, my GUI seems to become unresponsive - which is what im trying to avoid Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 29, 2010 Share Posted July 29, 2010 I don't think so. Let's say ... Your main script looks like this: ConsoleWrite("Start" & @CRLF) If @Compiled Then Run('"' & @AutoItExe & '" ' & @AutoItPID) Else Run('"' & @AutoItExe & '" ' & '/AutoIt3ExecuteScript "' & "Msgbox.au3" & '" ' & @AutoItPID, '', @SW_HIDE) EndIf For $i = 0 To 10 ConsoleWrite($i & @CRLF) Sleep(1000) Next and you helper script is namend Msgbox.au3 in the same folder. The MsgBox.au3 looks like this MsgBox(0, "Hello", "Hello") As you can see, the main script runs although the MsgBox is shown, cause it is run in a seperate process. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
gcue Posted July 29, 2010 Author Share Posted July 29, 2010 ooo so 2 seperate au3 files? im confused.. so the script i have now that runs the copywithprogress part is considered the main script or is that the second script? the @ScriptFullPath and @AutoitPID variables are throwing me off.. Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 29, 2010 Share Posted July 29, 2010 Okay, one more try. You want to execute an Autoit function from your main script. You tried your luck with AutoIt3ExecuteLine, but this command will fail when calling a complete function within your script.Another way would be starting your code in a complete other process by using the function I posted above. This way you need to put the code in another *.au3 file which will be given to the autoit3.exe to start it. This is nearly the same way an Autoitscript.exe works. There is the kernel (Autoit3.exe) and the au3Script bundled in the exe. Starting the exe the kernel will read the au3 script and executes it. Does the clearify anything?Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
gcue Posted July 30, 2010 Author Share Posted July 30, 2010 actually i just used autoit3executeline with filecopy/dircopy thanks =) 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