Jump to content

Recommended Posts

Posted (edited)

#include <IE.au3>

; Internet Explorer is partly integrated in shell.application

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

$MyIExplorer=""

for $Window in $oShellWindows ; Count all existing shell windows

; Note: Internet Explorer appends a slash to the URL in it's window name

if StringInStr($window.LocationURL,"http://URL.jsp") then

$MyIExplorer=$Window

exitloop

endif

next

$oForm = _IEGetObjByName ($MyIExplorer, "alfFileInput")

_IEAction($oForm, "click")

Hi guys I am new to AutoIT and trying to learn things asap.Can some1 explain me the code mentioned above especially the below portion.This code is to upload a file in active window.

MyIExplorer=""

for $Window in $oShellWindows ; Count all existing shell windows

; Note: Internet Explorer appends a slash to the URL in it's window name

if StringInStr($window.LocationURL,"http://URL.jsp") then

$MyIExplorer=$Window

exitloop

endif

next

Edited by vamsikrishna
Posted

#include <IE.au3>
; Internet Explorer is partly integrated in shell.application
$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object
$oShellWindows = $oShell.windows ; Get the collection of open shell Windows
$MyIExplorer = ""
For $Window In $oShellWindows ; Count all existing shell windows
    ; Note: Internet Explorer appends a slash to the URL in it's window name
    If StringInStr($window.LocationURL, "http://URL.jsp") Then
        $MyIExplorer = $Window
        ExitLoop
    EndIf
Next
$oForm = _IEGetObjByName($MyIExplorer, "alfFileInput")
_IEAction($oForm, "click")
MyIExplorer = ""
For $Window In $oShellWindows ; Count all existing shell windows
    ; Note: Internet Explorer appends a slash to the URL in it's window name
    If StringInStr($window.LocationURL, "http://URL.jsp") Then
        $MyIExplorer = $Window
        ExitLoop
    EndIf
Next

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Posted (edited)

MyIExplorer="" ; Put nothing in a variable called MtlExplorer

for $Window in $oShellWindows ; Count all existing shell windows, this is exactly what it does

; Note: Internet Explorer appends a slash to the URL in it's window name

if StringInStr($window.LocationURL,"http://URL.jsp") then ; Find a string inside of a string (I think)

$MyIExplorer=$Window ; set a variable as antoher variable

exitloop ; exits the loop

endif ; this tells the script to end if a certain expression is met

next ; do it again (i dunno )

im new at autoit too, this is proberbly a wrong explination .(Ive just woke up lol)

Someone with more experience in com and objects will proberbly aswer this properly soon.

Sparksoft :graduated:

EDIT: Haha while i was writing this someone did :(

Edited by SparkSoft

[center]First Ever Script/App[/center][center]Simple Battery Meter[/center]

Posted

EDIT: Haha while i was writing this someone did :(

?, Your sure about that.

MyIExplorer = "" ; Put nothing in a variable called MtlExplorer
For $Window In $oShellWindows ; Count all existing shell windows, this is exactly what it does
    ; Note: Internet Explorer appends a slash to the URL in it's window name
    If StringInStr($window.LocationURL, "http://URL.jsp") Then ; Find a string inside of a string (I think)
        $MyIExplorer = $Window ; set a variable as antoher variable
        ExitLoop ; exits the loop
    EndIf ; this tells the script to end if a certain expression is met
Next ; do it again (i dunno )

:graduated:

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Posted

That ... or I just copied and past un-tagged code from ... posters into [autoit] ... [/autoit] tags. :(

Func SparkSoft()
  Return SparkSoft()
Endfunc
:graduated:

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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
×
×
  • Create New...