Jump to content
Sign in to follow this  
GooGooDolls

Write url in box, click ok....open URL in browser

Recommended Posts

GooGooDolls

Yeah so basically I am trying to create a little script that will let me insert an address in a box, and then open up Internet Explorer and automatically go to that address. I tried doing it by looking at other scripts but I can't get pass the URL to IE...

Is there a way to add the user input as a switch to IE? Like so --> IEXPLORE.EXE http://www.xxx.xxx

#include <GUIConstantsEx.au3>
#include <IE.au3>

Opt("WinTitleMatchMode", 2); Other Option for WinWaitActive

GUICreate("URL Opener", 260, 100)
GUISetFont(8.5, 800)

GUICtrlCreateLabel("URL to open:", 90, 13)

GUISetFont(8.5, 400)

;Button
$input1 = GUICtrlCreateInput("", 10, 29, 240, 20)


$ok = GUICtrlCreateButton("Ok", 90, 60, 100, 25)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()

    Select
       ;------------ OK Button  - Finished
        Case $msg = $ok
            $sRead = GUICtrlRead($input1)
            Run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE") <--NEED URL HERE AS SWITCH??
            WinWait("[CLASS:IEFrame]")
            //$sRead = GUICtrlRead($input1)
            //ControlSetText("[CLASS:IEFRAME]", "", "Edit1", $sRead)
           ;------------ Cross  - Finished
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

Help needed...

Share this post


Link to post
Share on other sites
billthecreator

i believe you can do this: i could be wrong

Run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE" & " " & GuiCtrlRead($input))oÝ÷ Ø¥Á¬¬ºÇ¬ée{º×ºÚ"µÍÚ[^XÝ]J   ][ÝÚËÝÝÝËÙXÚ]KÛÛI][ÝÊ
Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites
GooGooDolls

Run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE" & " " & GuiCtrlRead($input))

That gave me error on line 28

Error: Variable used without being declared

How do I declare it? :)

Share this post


Link to post
Share on other sites
BrettF

Share this post


Link to post
Share on other sites
GooGooDolls

Ok, I got it working. Apparently there is a difference between writing $input and $input1 :)

One more thing though, how would you insert the input inside an URL?

Example:

http://www.google.com/search?hl=sv&q=britney&btnG=S%C3%B6k&meta=

so in my program I would just write britney...

...and it would take that input and place it between http://www.google.com/search?hl=sv&q= and ]&btnG=S%C3%B6k&meta=

The above is just an example from the top of my head, but you understand what I mean right? Good! :lmao:

Share this post


Link to post
Share on other sites
BrettF
GooGooDolls

string concatenation

Well, now that I know what it's called I might actually find some info about it. (Lucky you already gave me the solution.) :)

So, everything is working as it should now, thx for all the help! Couldn't have done it without you...

Share this post


Link to post
Share on other sites
feedbackForForums

In a related matter, how would I actually select the edit control that serves as the address box? I want to select the url edit box, or address bar, and overwrite whatever's there.

Right now I am tabbing back and forth to get this to happen, but it is sloppy and the solution goes out the window (erm, figuratively, not literally) as soon as I do something like a mouse click since the focus changes.

Judging from other posts and my own searching, it seems like AutoIt is perfectly suited to getting this focus on the address bar by retrieving the Class, Instance, ClassNameNN, and Advanced (Class). How do I actually tell my script "Put the focus on this control which is associated with properties Cass X, Instance Y, ClassNameNN Z, etc."?

I am replying to THIS thread in particular because this seemed like the most suitably-titled thread in my searches. If I missed something in the Help that could have answered this, please tell me where I can find it instead of just "look in the Help files". Thank you!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×