AlexFing17 Posted March 23, 2017 Share Posted March 23, 2017 hello I am totally new to autoIt. But i have a project to finish . My group and I have to create program that will automate Task. We have to create a program will functions like schedule pc to turn off at specific time, creates a folder and move files from one for to it, delete a file from a specific, play all music in a folder. We are have all this functions coded. But the problem here is that. The main program has to be a program that user will select what they want to be automated and the click on generate to generate an exe file that would automate spefic functions that was selected from the main program. So if i should select functions like ( play music, shutdown after 4 hours, create folder and move files from specific folder to it) from the main gui of the main program and then click on generate. The main program has to generate an exe file with the select functions only. How can i do that please. I really need help. Thank you. Xandy 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 23, 2017 Moderators Share Posted March 23, 2017 AlexFing17, Welcome to the AutoIt forums. Wow - as a first task in AutoIt you have chosen a really difficult one! However, I can certainly confirm that it is not an impossible one, You say that you have created the individual functions for each of the tasks - a great start. As I understand it you now need some form of GUI where the user can select which of these functions to run - I would suggest an array of Checkbox controls which you can read to indicate the functions required. That should not be too difficult to code - look at GUICtrlCreateCheckbox in the Help file to see how it is done. But the production of an executable including the required functions is the tricky bit. I produced an example script some time ago which showed how you can do something like this by creating an .au3 script "on the fly" and then compiling it. Although not precisely what you are looking for, the script shows the various steps required and merits a close look to see how I managed to do it. Have a go at producing something with your group and by all means come back if you run into problems. M23 Xandy 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Miloud Posted March 23, 2017 Share Posted March 23, 2017 I imagine that your full-of-functions script looks like this: Func func1() ;.... EndFunc Func func2() ;.... EndFunc Func func3() ;.... EndFunc Here is my suggestion: 1- copy your script to msWord 2- run command replace by pressing ctrl+h 3- write on find "endfunc^p^pfunc" and in replace "endfunc^pfunc" and run it several times. 4- write on find "endfunc^pfunc" and in replace "endfunc^p|^pfunc" notice that the script should look like this: Func func1() ;.... Endfunc | func func2() ;.... Endfunc | func func3() ;.... EndFunc 5- save it as "myFunctions.txt" 6- after building the gui as suggested by Melba23 , make a command to open "myFunctions.txt", split its contents with "|", and write the needed functions on an external file with autoit extension then run it. You should consider that some of your functions require #include write an array of them. Link to comment Share on other sites More sharing options...
AlexFing17 Posted March 25, 2017 Author Share Posted March 25, 2017 Thanks This was really Helpfull 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