vamsikrishna Posted November 30, 2010 Share Posted November 30, 2010 (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 November 30, 2010 by vamsikrishna Link to comment Share on other sites More sharing options...
MvGulik Posted November 30, 2010 Share Posted November 30, 2010 #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 ... Link to comment Share on other sites More sharing options...
SparkSoft Posted November 30, 2010 Share Posted November 30, 2010 (edited) MyIExplorer="" ; Put nothing in a variable called MtlExplorerfor $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 nameif StringInStr($window.LocationURL,"http://URL.jsp") then ; Find a string inside of a string (I think)$MyIExplorer=$Window ; set a variable as antoher variableexitloop ; exits the loopendif ; this tells the script to end if a certain expression is metnext ; 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 EDIT: Haha while i was writing this someone did Edited November 30, 2010 by SparkSoft [center]First Ever Script/App[/center][center]Simple Battery Meter[/center] Link to comment Share on other sites More sharing options...
MvGulik Posted November 30, 2010 Share Posted November 30, 2010 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 ) "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 ... Link to comment Share on other sites More sharing options...
SparkSoft Posted December 1, 2010 Share Posted December 1, 2010 (edited) You proberly typed faster then me and posted while I was writing Edited December 1, 2010 by SparkSoft [center]First Ever Script/App[/center][center]Simple Battery Meter[/center] Link to comment Share on other sites More sharing options...
MvGulik Posted December 1, 2010 Share Posted December 1, 2010 That ... or I just copied and past un-tagged code from ... posters into [autoit] ... [/autoit] tags. Func SparkSoft() Return SparkSoft() Endfunc "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 ... 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