AlexFing17

Need Help

4 posts in this topic

#1 ·  Posted

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.

1 person likes this

Share this post


Link to post
Share on other sites



#2 ·  Posted

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

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted

Thanks This was really Helpfull

Share this post


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