Jump to content

Branch To Line Label Or Sub-routine In Autoit?


Recommended Posts

OK. I am not much of a programmer (surprise!) so the answer to this question could range from "that is obvious" to "why would you want to do that?" to "it can't be done that way", but here it is...

I have written a compiled AutoIt script that runs 6 other installation programs in sequence. I have also started work on a simple VB program that is a user interface for the Autoit script, that allows a user to select which of the 4 programs to install (and there eventually will be more than 6 options). I realize that I could have the VB program just run a seperate compiled AutoIt script for each option, but that would start to bloat the code with 80k for each option, so what I would like to do is have one AutoIt script that contains all the options (only about 84k) and have the VB program run it and branch to the correct line label or sub-routine within the AutoIt script to perform the chosen task(s).

I would be happy to run the user interface from AutoIt, but I don't see Option Buttons, etc.

If I described that in a way that anyone else can understand, how could I do this? Any suggestions?

Thanks...

Automan Empire

"I've seen your work in the past, and it's novice at best..." SmOke_N
Link to comment
Share on other sites

although I wouldn't suggest using for production, Autoit in the unstable version has a new GUI that will allow everything you say you need.

You can have checkboxes, drop downs, etc.

The other option would be to popup a HTML page and do the selections there ( I have shown how to do that in the scraps forrum)

The new GUI take a bit to understand it, but if you are already doing VB, I would imagine you would figure it out quick.

http://www.hiddensoft.com/autoit3/files/unstable/autoit/

You can ask GUI questions here as well if you get stuck, but please read the manual on it first.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

I have written a compiled AutoIt script that runs 6 other installation programs in sequence. I have also started work on a simple VB program that is a user interface for the Autoit script, that allows a user to select which of the 4 programs to install (and there eventually will be more than 6 options). I realize that I could have the VB program just run a seperate compiled AutoIt script for each option, but that would start to bloat the code with 80k for each option, so what I would like to do is have one AutoIt script that contains all the options (only about 84k) and have the VB program run it and branch to the correct line label or sub-routine within the AutoIt script to perform the chosen task(s).

Why not just use VB, if all you want to do is launch programs based on a users selection. Use the Shell() function and also the Sleep() function to pause in between program launches. By the way your compiled VB app will only be about 20KB max.

Link to comment
Share on other sites

Thank you all for the replies.

although I wouldn't suggest using for production, Autoit in the unstable version has a new GUI that will allow everything you say you need.

You can have checkboxes, drop downs, etc.

The other option would be to popup a HTML page and do the selections there ( I have shown how to do that in the scraps forrum)

Thanks I will check out the new GUI and the HTML selection scrap.

Why not just use VB, if all you want to do is launch programs based on a users selection. Use the Shell() function and also the Sleep() function to pause in between program launches. By the way your compiled VB app will only be about 20KB max.

I tried that first, but VB 6 does not have nice features like AutoIt for recognizing windows opening and closing, as well as clicking on controls. Sendkeys was not reliable enough for me.

Runtime is 1.5 meg or so. So any VB app is at least 1.5 meg.

Yep. Size will be a factor for my application, and I will not be able to assume that a user will have the VB runtime.

After I posted the message, I saw the example (in Help :D ) about passing command line parameters to a script. If I can get that to work, it should do the job for me.

"I've seen your work in the past, and it's novice at best..." SmOke_N
Link to comment
Share on other sites

  • 2 weeks later...

If the GUI doesn't work for you (which would be the more appropriate solution), maybe you can make the script accept command line options so that it knows which program to run.

EDIT: OMG, you already arrived at that solution (command line). Sorry, I didn't read to the end of the last post. :huh2::D

Edited by kalayaan
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...