Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 StartupFunc() Func StartupFunc() Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MAXIMIZE) Run('"C:\Program Files\AutoIt3\SciTe\SciTE.exe"', "C:\Program Files\AutoIt3\SciTe") Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFuncJust a startup script. Gives me a stupid error... >"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3" C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (32) : ==> Unable to execute the external program.: Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") >Exit code: 0 Time: 0.219Why isn't it working??? Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 One more thing to add: Is it possible to assign that function to a variable? Or can you not assign functions to variables? Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 29, 2004 Share Posted September 29, 2004 CHM files are not executables, they do not work with the run command. You need to associate them with something. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
t0ddie Posted September 29, 2004 Share Posted September 29, 2004 (edited) you can run .exe with run, but to open another program such as .txt files.. you need to run notepad. i dont know what you need to run .chm.. but see what program opens that.. and then run that. EDIT: ahahaaa matt you beat me by like 2 seconds Edited September 29, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
t0ddie Posted September 29, 2004 Share Posted September 29, 2004 a variable stores information. you cannot assign a function to it. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 So the helpfile is obsolete? That sucks =/. Also, I wanted to make an inputbox, if 1, then run script, if 0, then do not run script. Link to comment Share on other sites More sharing options...
t0ddie Posted September 29, 2004 Share Posted September 29, 2004 i have no idea what you are trying to do... but the help file opens.. it is more advanced format than a simple .txt file so, just doubleclick it or right click run. why are you trying to open the help file from a script? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 A startup script, so when you start the computer it automatically runs all the scripting tools, helpfile, scite, winspy, etc... and also opens up the autoit forums. How would I open the help file through Start->Run? Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 I wanted to do: IF the user inputs 1, then run the script IF the user inputs 0, then do not run the script Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 Fixed! I now know the problem, needed to add a few sleeps. Here is new script: StartupFunc() Func StartupFunc() Send("{LWIN}{ENTER}") MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}") ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) WinSetState("AutoIt Help", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE) Sleep(500) Send("{LWIN}{ENTER}") Sleep(500) MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}") WinWaitActive("Scripts") WinSetState("Scripts", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) Sleep(500) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFunc Question: How can I make this script into a yes or no script. So that the user can enter either yes, to start it, or no, to no start it... Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 29, 2004 Share Posted September 29, 2004 Read documentation on MsgBox... HINT: Flags. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 Thanks. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 29, 2004 Share Posted September 29, 2004 expandcollapse popupMsgBox(4, "AutoIt Startup Script - Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.") If 6 then Return EndIf If 7 then StartupFunc() Func StartupFunc() Send("{LWIN}{ENTER}") MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}") ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) WinSetState("AutoIt Help", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE) Sleep(500) Send("{LWIN}{ENTER}") Sleep(500) MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}") WinWaitActive("Scripts") WinSetState("Scripts", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) Sleep(500) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFunc I added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script? Link to comment Share on other sites More sharing options...
magaf Posted September 29, 2004 Share Posted September 29, 2004 (edited) If MsgBox(4, "AutoIt Startup Script - Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")=7 then exit Edited September 29, 2004 by magaf Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 29, 2004 Share Posted September 29, 2004 expandcollapse popupMsgBox(4, "AutoIt Startup Script - Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.") If 6 then Return EndIf If 7 then StartupFunc() Func StartupFunc() Send("{LWIN}{ENTER}") MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}") ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) WinSetState("AutoIt Help", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE) Sleep(500) Send("{LWIN}{ENTER}") Sleep(500) MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}") WinWaitActive("Scripts") WinSetState("Scripts", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) Sleep(500) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFuncI added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script?<{POST_SNAPBACK}>Return doesn't continue the script. just do a return 0.*** Matt @ MPCS Link to comment Share on other sites More sharing options...
mlister Posted September 29, 2004 Share Posted September 29, 2004 if MsgBox(4, "Title", "Startup Script") = 7 then Exit EndIf This will only run the code if Yes is pressed. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 30, 2004 Share Posted September 30, 2004 I have this: expandcollapse popup;Starts up AutoIt scripting tools on startup with a yes or no option. $start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0) If $start = 1 Then ;What Do i put here to make it continue running script... EndIf If $start = 0 Then Exit StartupFunc() Func StartupFunc() Send("{LWIN}{ENTER}") MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}") ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) WinSetState("AutoIt Help", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE) Sleep(500) Send("{LWIN}{ENTER}") Sleep(500) MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}") WinWaitActive("Scripts") WinSetState("Scripts", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) Sleep(500) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFunc What do I insert after If $start = 1 to make it run the script? Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 30, 2004 Share Posted September 30, 2004 expandcollapse popup;Starts up AutoIt scripting tools on startup with a yes or no option. $start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0) If $start = 0 Then Exit EndIf If $start = 1 Then StartupFunc() Func StartupFunc() Send("{LWIN}{ENTER}") MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}") WinWaitActive("AutoIt Help") WinSetState("AutoIt Help", "", @SW_MAXIMIZE) WinSetState("AutoIt Help", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3") WinWaitActive("AutoIt v3 Active Window Info") WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE) Sleep(500) Send("{LWIN}{ENTER}") Sleep(500) MouseClick("left", 237, 875, 1) Sleep(500) Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}") WinWaitActive("Scripts") WinSetState("Scripts", "", @SW_MINIMIZE) Sleep(500) Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer") Sleep(2000) WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" ) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) Sleep(500) MouseClick("left", 300, 100, 1) Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}") EndFunc EndIfEdited: BUT, now it's giving me an error. Ideas?>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3" C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (36) : ==> "If" statement has no matching "EndIf" statement.: Func StartupFunc() >Exit code: 1 Time: 0.214 Link to comment Share on other sites More sharing options...
Developers Jos Posted September 30, 2004 Developers Share Posted September 30, 2004 dont put functions inside of IF...ENDIF Just get rid of the "If $start = 1 Then" and the last "EndIF" SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 30, 2004 Share Posted September 30, 2004 Thanks JdeB, I never even thought of it like that. 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