niruse Posted April 27, 2013 Share Posted April 27, 2013 (edited) sorry for didnt write any information at title i forgothi guys i still learning autoit script and i have a small question if anyone knows.my script make a question of yes and no and i wanna make an option for my client .when he press no i wanna let him choose the time to run script, and after the time gone it ask again if run the script or wait again(i wanna backup outlook files and i cant close the program when my manager write some important mails so i let him choose the time).thanks anyways; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)$answer = MsgBox(4, "AutoIt Example (English Only)", "run backup now?"); Check the user's answer to the prompt (see the help file for MsgBox return values); If "No" was clicked (7) then exit the scriptIf $answer = 7 Then MsgBox(0, "choose time to run backup")EndIf; Run MSDosRun("notepad.exe")WinWaitActive("[CLASS:Notepad]") Edited April 27, 2013 by niruse Link to comment Share on other sites More sharing options...
Neutro Posted April 27, 2013 Share Posted April 27, 2013 (edited) Hello, If $answer = 7 This will put the value "7" inside the variable "$answer". For testing if the variable "$answer" is equal to the value "7", you need to use the double equal sign like this: If $answer == 7 Edited April 27, 2013 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Vincor Posted April 27, 2013 Share Posted April 27, 2013 Hi Neutro - please double-check your post. AutoIt "=" and "==" are not like in C/C++, like you described. Both can be used for comparison. If $answer = 7 This will put the value "7" inside the variable "$answer". See http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm Neutro 1 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 27, 2013 Share Posted April 27, 2013 A double equal (==) would be used to check two strings if they are case-sensitive equal. So niruse you are correct with $answer = 7.Language Reference - Operators - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Vincor Posted April 27, 2013 Share Posted April 27, 2013 niruse, maybe this helps you. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "run backup now?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then Local $minutes = InputBox("Postpone backup", "How many minutes to postpone the backup?", 10) ; question box, default to 10 minutes Sleep($minutes*60000) ; Sleep is in msecs, so multiply input in minutes by 60*1000 to have it in msecs EndIf ; Run MSDos Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") Link to comment Share on other sites More sharing options...
niruse Posted April 27, 2013 Author Share Posted April 27, 2013 (edited) ty for help now i gonna try hope ill back with asnwers niruse, maybe this helps you. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "run backup now?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then Local $minutes = InputBox("Postpone backup", "How many minutes to postpone the backup?", 10) ; question box, default to 10 minutes Sleep($minutes*60000) ; Sleep is in msecs, so multiply input in minutes by 60*1000 to have it in msecs EndIf ; Run MSDos Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") ty now ill learn and read it works well Edited April 27, 2013 by niruse Link to comment Share on other sites More sharing options...
Neutro Posted April 27, 2013 Share Posted April 27, 2013 Doh my bad then! Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! 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