BALA Posted December 11, 2006 Share Posted December 11, 2006 (edited) Is it possible to have a program execute commands written in a text file? Edited December 11, 2006 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Valuater Posted December 11, 2006 Share Posted December 11, 2006 (edited) yes ..................... inside file.. RunNote ............... Script Call(FileReadLine($File, 1)) Func RunNote() Run("Notepad.exe") EndFunc 8) Edited December 11, 2006 by Valuater Link to comment Share on other sites More sharing options...
BALA Posted December 11, 2006 Author Share Posted December 11, 2006 Sorry for the ignorance, but could you elaborate on that? [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
The Kandie Man Posted December 11, 2006 Share Posted December 11, 2006 (edited) Valuater's example reads a text file. The text file has nothing in it but this: RunNote The script that he has reads that text file's first line which is RunNote and from there it then calls the function RunNote() that is located in the script. You could have it call any function in the script this way. Another way you can do this is by using the /AutoIt3ExecuteScript method. Check out my External Excute UDF in my signature. It is a UDF that will allow a compiled script to execute other scripts that are in au3 or a3x format. This allows for a dynamic functionality, similar to dll files. Edited December 11, 2006 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
BALA Posted December 11, 2006 Author Share Posted December 11, 2006 Ah, thank you. [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
dandymcgee Posted December 12, 2006 Share Posted December 12, 2006 Another example: script: $read = IniRead("script.ini", "Section1", "1", "error") If $read = "error" Then MsgBox(0, "ERROR", "An unknown error has occured.") EndIf $split = StringSplit($read, ",") Select Case $split[0] = 0 Call("MBox", 0, "ERROR", "Undefined Parameters") Case $split[0] = 1 Call($split[1], 0, "ERROR", "Undefined Parameters") Case $split[0] = 2 Call($split[1], 0, "ERROR", "Undefined Parameters") Case $split[0] = 3 Call($split[1], 0, "ERROR", "Undefined Parameters") Case $split[0] = 4 Call($split[1], $split[2], $split[3], $split[4]) Case $split[0] = 5 Call($split[1], $split[2], $split[3], $split[4], $split[5]) EndSelect Func MBox($flag, $title, $text, $timeout) MsgBox($flag, $title, $text, $timeout) EndFunc script.ini file: [section1] 1 = MBox, 0, Testing My Function, Did it work right?, 3 Doesn't have to be .ini file, but i prefer to use .ini files in my scripting. Just another example to maybe help you understand. - Dan [Website] 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