jayblack69 Posted March 10, 2014 Share Posted March 10, 2014 I am extremely new to AutoIT and not barely 'experienced' in scripting. I am trying to make a simply scritp to: Change this IE Setting: Local Intranet > Custom Level > "Init & script Active X not safe...": -change to "Emable" Change these Excel Settings: Excel Options > Trust Center > 'Trust Settings' > Macro Settings: -Check "Trust access to Visual Basic Project" -Select "Trust access to the VBA project onject model" I would like to be able to code the script to: (1) open IE regardless of version or home page. (2) run verbosely and, (3) automatically pause after each command; (5) on a keystroke, run the next line. For testing & evaluation. My thanx in advance for any help and understanding... The Script so far: (how bad is it?) Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe") Opt("WinTitleMatchMode", 4) WinWait("Windows Internet Explorer","Navigation Bar") WinWait("Command Bar","") $Tabhdl = ControlGetHandle("Command Bar","","SysTabControl321") ControlCommand("","",$Tabhdl,"TabRight","") WinWait("Internet Options","Select a web content zone to s") WinWait("Internet Options","Select a web content zone to s") $CLVItem = ControlListView("Internet Options","Select a web content zone to s","SysListView321","FindItem","Local intranet") ControlListView("Internet Options","Select a web content zone to s","SysListView321","SelectClear") ControlListView("Internet Options","Select a web content zone to s","SysListView321","Select",$CLVItem) ControlClick("Internet Options","Select a web content zone to s","Button2") WinWait("Security Settings - Local Intranet Zone","*Takes effect after you restar") ControlClick("Security Settings - Local Intranet Zone","*Takes effect after you restar","SysTreeView321") ControlClick("Security Settings - Local Intranet Zone","*Takes effect after you restar","Button4") WinWait("Internet Options","Select a web content zone to s") ControlClick("Internet Options","Select a web content zone to s","Button7") WinClose("[CLASS:IEFrame]") Run("C:Program Files (x86)Microsoft OfficeOffice15EXCEL.EXE") Opt("WinTitleMatchMode", 4) WinWait("Book1 - Excel","Status Bar") ControlClick("Book1 - Excel","Status Bar","MsoCommandBar2") WinWait("Book1 - Excel","") ControlClick("Book1 - Excel","","NetUIHWND1") WinWait("Excel Options","") ControlClick("Excel Options","","NetUIHWND1") WinWait("Trust Center","") ControlClick("Trust Center","","NetUIHWND1") WinWait("Excel Options","") ControlClick("Excel Options","","NetUIHWND1") WinWait("Book1 - Excel","Status Bar") ControlClick("Book1 - Excel","Status Bar","MsoCommandBar2") Link to comment Share on other sites More sharing options...
JohnOne Posted March 10, 2014 Share Posted March 10, 2014 To do hat you want, you'll have to create a function to wait for a key press and call that function after every line of your script. 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...
Bert Posted March 11, 2014 Share Posted March 11, 2014 This is SO much easier handled by command line. I see you want to add rights then add a command bar into Excel. Both are easy to do in command line. http://stackoverflow.com/questions/20323569/how-to-set-internet-explorer-security-settings-from-command-prompt http://support.microsoft.com/kb/830502 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jayblack69 Posted March 11, 2014 Author Share Posted March 11, 2014 To do hat you want, you'll have to create a function to wait for a key press and call that function after every line of your script. OK, that sounds like what I want... For the script to pause after each line is run... will give it a try. Thanx! Link to comment Share on other sites More sharing options...
jayblack69 Posted March 11, 2014 Author Share Posted March 11, 2014 This is SO much easier handled by command line. I see you want to add rights then add a command bar into Excel. Both are easy to do in command line. http://stackoverflow.com/questions/20323569/how-to-set-internet-explorer-security-settings-from-command-prompt http://support.microsoft.com/kb/830502 Actually, I was wondering if a set of reg entries would be better and simpler... Link to comment Share on other sites More sharing options...
Bert Posted March 11, 2014 Share Posted March 11, 2014 Reg entries "can" do it but command line is the best way to go. You can do this with just a few lines of code. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
DW1 Posted March 11, 2014 Share Posted March 11, 2014 To step through as you were asking, as long as you are using the full Scite4AutoIt package, you can use Tools>"Trace: Add Trace Lines". This will add debugging to console for each line. To make them pause each time, just do a search>replace "ConsoleWrite('>Error code" --> "MsgBox(0,'Step','>Error code" When you are done debugging, reverse the search>replace and then use Tools>"Trace: Remove ALL trace lines" AutoIt3 Online Help Link to comment Share on other sites More sharing options...
jayblack69 Posted March 11, 2014 Author Share Posted March 11, 2014 Reg entries "can" do it but command line is the best way to go. You can do this with just a few lines of code. As I said, I am really new to this and I am finding it is the intial "how I'm gonna do this" seems to be the hardest part... Please explain why/how what looks to me like far fewer lines of coding reg entries can be more than what I have so far tried. I am sure I am missing something. Everytime I test my current script it opend IE and then stops with the script showing as "script paused" in the taskbar... (PLEASE keep in mind I am really THAT new to coding. 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