Jump to content

Is it possible to 'step through' a script, and other lowly queries... Mr. Vey Renew to AutoIT.


Recommended Posts

Posted

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")

Posted

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!

Posted

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"

Posted

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.

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
  • Recently Browsing   0 members

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