Jump to content

Recommended Posts

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.

Link to post
Share on other sites
  • Moderators


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.


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Link to post
Share on other sites

I imagine that your full-of-functions script looks like this:

Func func1()

Func func2()
Func func3()

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()
func func2()
func func3()

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 post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...