empach Posted November 8, 2009 Share Posted November 8, 2009 hi everyone!! firstly, before anyone tells me to search the help section, please let me explain my situation. i am completely new to programming and have only downloaded autoit yesterday, i have been trying out the tuturials and they have got me hooked!! i do not understand all the terminology in the program and have looked through the forum for the answer but i dont understand some of the topics so i thought i just blurt it out in the form of a question to you guys! working on the tutorial to open up notepad, is there a way of asking the user to input a number of instances that would open notepad?? say if the user wanted 3 instances of notepad, there would be a popup asking this and the number inputted would then launch 3 notepad instances. this to me in english terms sounds so simple yet i cannot find a script that does this and there must be a way of doing it. i get the msgbox script but not sure how to adapt it to input nembers. any help on this would be fantastic, even though its not for anything important! thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted November 8, 2009 Share Posted November 8, 2009 (edited) If you look at loops, for instance for...next, you would put the code you want to loop, where the msgbox "countdown" is, and the script after that where "blast off" is. Edited November 8, 2009 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2009 Moderators Share Posted November 8, 2009 empach,First, welcome to the AutoIt forums. Now guess what I am going to say!Read the Help file! Seriously, if you are that new to programming/coding (and that is not a problem -everyone has to start somewhere!) you do need to understand how some of the basic functions work or both you and we are going to get frustrated very quickly. You need to work through the tutorials you have started - the answers to many of the questions you will want to ask are covered there. There are even video tutorials on YouTube if you prefer watching to reading.The best way to learn is to study the simple examples in the Help file until you are sure you understand what is going on and, more importantly, why. Change something in the examples to see if what happens is what you expect (not always the case).Anyway, as to your specific question - take a look at this:; Ask how many Notepads to open $sCount = InputBox("Multiple Notepads", "How many Notepads do you want to open (1-3)", "", "", 200, 150) ; The result is in string form, so convert to a number $iCount = Number($sCount) ; Check it is in range 1-3 If $iCount >= 1 And $iCount <= 3 Then ; Open the correct number of notepads For $i = 1 To $iCount Run("notepad.exe") WinWaitActive("Untitled - Notepad") Next EndIfRead the Help file pages for the various commands carefully and I am sure you will soon see what is going on.Have fun!M23 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...
empach Posted November 8, 2009 Author Share Posted November 8, 2009 If you look at loops, for instance for...next, you would put the code you want to loop, where the msgbox "countdown" is, and the script after that where "blast off" is.thanks,i did look at this but this example makes you click before the next countdown number appears, and being completely new i didnt - and still dont understand the loop function fully. i wanted to automatically launch a usder suggested number of instances ans wasnt sure how i could change the loop script to my favour. thanks for your help anyway!! Link to comment Share on other sites More sharing options...
empach Posted November 8, 2009 Author Share Posted November 8, 2009 empach, First, welcome to the AutoIt forums. Now guess what I am going to say! Read the Help file! Seriously, if you are that new to programming/coding (and that is not a problem -everyone has to start somewhere!) you do need to understand how some of the basic functions work or both you and we are going to get frustrated very quickly. You need to work through the tutorials you have started - the answers to many of the questions you will want to ask are covered there. There are even video tutorials on YouTube if you prefer watching to reading. The best way to learn is to study the simple examples in the Help file until you are sure you understand what is going on and, more importantly, why. Change something in the examples to see if what happens is what you expect (not always the case). Anyway, as to your specific question - take a look at this: ; Ask how many Notepads to open $sCount = InputBox("Multiple Notepads", "How many Notepads do you want to open (1-3)", "", "", 200, 150) ; The result is in string form, so convert to a number $iCount = Number($sCount) ; Check it is in range 1-3 If $iCount >= 1 And $iCount <= 3 Then ; Open the correct number of notepads For $i = 1 To $iCount Run("notepad.exe") WinWaitActive("Untitled - Notepad") Next EndIf Read the Help file pages for the various commands carefully and I am sure you will soon see what is going on. Have fun! M23 WOW!!!!!! THIS IS PERFECT!!!!!! i had searched the "does not understand functions" like cycle, repeat, goto line, again etc, but couldnt get anywhere!! i take on board about the self searching for help, and i know i would upset lots of people if i just asked a question to any problem i had or did not understand, and in any case i do see that as cheating cos i would be asking you guys to write my script for me!! but thanks again for your assistance, it has shown me the light of my problem (however small it may seem!!) THANKYOU!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2009 Moderators Share Posted November 8, 2009 empach,Glad I could be of help.A small suggestion - if you use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button at the bottom of the post, you do not include the text of the previous post in your reply. I am sure you can see how this makes reading the thread much easier - and saves on server space. M23 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...
empach Posted November 8, 2009 Author Share Posted November 8, 2009 no probs M23, thanks again!! just to let youknow how much ive played with your script - yes! i am impressed!! - i now have it opening a selected number then sleeping then closing the same amount of instances opened, then exitting with a task complete message box!! wahey!! it may sound stupid and so trivial to some people but this is only the start of my programming!! and its very addictive!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2009 Moderators Share Posted November 8, 2009 empach, I have been coding as a hobby for over 40 years - it stays addictive! Welcome to our world. M23 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...
Mat Posted November 8, 2009 Share Posted November 8, 2009 I have been coding as a hobby for over 40 years - it stays addictive! Welcome to our world.As we have already turned the General help and support into an extra chat section a few times...How many of those 40 is AutoIt?? I only see you as being on the forums since Aug 08, so just entering your second year.As to addiction - I'm supposed to be studying at the moment, but it's really hard with a computer in front of you all the time. But I will continue to argue how educational it is.Mat AutoIt Project Listing 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