Jump to content

_IEcreate


Recommended Posts

Why does it give me a error for _IEAttach while I'm not even using it?

btw, the msgbox DOES work, I just need to open a page with that link each time...

#include <IE.au3>
$oIE = _IECreate ("http://www.facebook.com/friends/?everyone&ref=tn")
$oLinks = _IELinkGetCollection ($oIE)
For $oLink In $oLinks
    If StringInStr($oLink.href ,"http://www.facebook.com/profile.php?id=") Then 
        $new_link = StringReplace($oLink.href, "http://www.facebook.com/profile.php?id=", "http://apps.facebook.com/inthemafia/status_invite.php?from=")
        MsgBox(0, "Link Info", $new_link); match all links that contain the word status_invite
_IECreate($new_link, 1)
    EndIf
Next

I'm using _IECreate and get a error for _IEAttach???

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Evil_elf\Desktop\auto-inviter.au3"

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

+>16:51:06 AutoIT3.exe ended.rc:0

+>16:51:07 AutoIt3Wrapper Finished

>Exit code: 0 Time: 19.393

Erm?? HELP!!!!! how can I get the right page open?

Link to comment
Share on other sites

Depended on the extra information that href is holding apart from the string you changed. If you're asking if the call is correct then I see no problem with _IECreate($new_link). If it'll eventually navigate to the correct page is depended on the href of the previous link.

Link to comment
Share on other sites

Depended on the extra information that href is holding apart from the string you changed. If you're asking if the call is correct then I see no problem with _IECreate($new_link). If it'll eventually navigate to the correct page is depended on the href of the previous link.

so to say it im simple language...

the text in the msgbox changes every time and that's each time the link I want to open. If that text changes, then the right page loads?

I know I'm a dumbass... took me 3h to figure this out...

Link to comment
Share on other sites

Why does it give me a error for _IEAttach while I'm not even using it?

btw, the msgbox DOES work, I just need to open a page with that link each time...

#include <IE.au3>
$oIE = _IECreate ("http://www.facebook.com/friends/?everyone&ref=tn")
$oLinks = _IELinkGetCollection ($oIE)
For $oLink In $oLinks
    If StringInStr($oLink.href ,"http://www.facebook.com/profile.php?id=") Then 
        $new_link = StringReplace($oLink.href, "http://www.facebook.com/profile.php?id=", "http://apps.facebook.com/inthemafia/status_invite.php?from=")
        MsgBox(0, "Link Info", $new_link); match all links that contain the word status_invite
_IECreate($new_link, 1)
    EndIf
Next

I'm using _IECreate and get a error for _IEAttach???

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Evil_elf\Desktop\auto-inviter.au3"

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

+>16:51:06 AutoIT3.exe ended.rc:0

+>16:51:07 AutoIt3Wrapper Finished

>Exit code: 0 Time: 19.393

If you didn't want to use _IEAttach(), then why did you set the $f_Attach parameter? Just do _IECreate($new_link) without the 1. What you got was a routine Warning, not an ERROR. It looked for a matching instance to attach to, because you told it to do that with $f_Attach = 1, and didn't find it, so a routine Warning was output before trying to open the page in a new instance of IE.

Erm?? HELP!!!!! how can I get the right page open?

The stuff about attaching has nothing to with "the right page" opening. Add some error checking to your script to see if the URL is right:
#include <IE.au3>

Global $sURL = "http://www.facebook.com/friends/?everyone&ref=tn"
Global $sSearch = "http://www.facebook.com/profile.php?id="
Global $sReplace = "http://apps.facebook.com/inthemafia/status_invite.php?from="
Global $oIE, $oLinks, $new_link

$oIE = _IECreate($sURL)
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If StringInStr($oLink.href, $sSearch) Then
        $new_link = StringReplace($oLink.href, $sSearch, $sReplace)
        ConsoleWrite("$new_link = " & $new_link & @LF)
        _IECreate($new_link)
    EndIf
Next

If it fails, examine the output to the console to see what's wrong, or cut/paste the new URL from the console to a browser to see what's up (that's easier to do from the SciTE console than from a MsgBox() dialog).

:P

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

ERROR...

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Evil_elf\Desktop\test psalty.au3"

--> IE.au3 V2.4-0 Error from function _IECreate (Browser Object Creation Failed)

--> IE.au3 V2.4-0 Error from function _IELinkGetCollection, $_IEStatus_InvalidDataType

C:\Documents and Settings\Evil_elf\Desktop\test psalty.au3 (22) : ==> Variable must be of type "Object".:

For $oLink In $oLinks

For $oLink In $oLinks^ ERROR

->17:37:46 AutoIT3.exe ended.rc:1

+>17:37:47 AutoIt3Wrapper Finished

>Exit code: 1 Time: 31.558

EDIT... nvm.. gonna restart the pc... I think I screwed some other things lol

Edited by Overlord
Link to comment
Share on other sites

You may want to add tabs to avoid creating several new processes of IE.

#include <IE.au3>
Dim Const $navOpenInNewTab = 0x0800

Dim $o_IE = _IECreate('http://www.google.com/')
$o_IE.Navigate2('http://www.yahoo.com', $navOpenInNewTab)

The thing to note about the new URL that it doesn't matter if it's correct or exist, it's your responsibility to use a correct one, but to open a new tab without getting run-time errors.

Link to comment
Share on other sites

Please note that _IECreate does not create a new ieplore.exe process just because it opens a new window. Creating the new browser instance in a new tab may make sense for other reasons, but it is not required in order to share an IE process. IE shares a single iexplore.exe over multiple instances by default.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

@Overlord - the browser creation failure is, in every instance I've seen, caused by a temporary issue on your system. You could have exhausted some system resource or more likely have an iexplore.exe process running on your system that is not responding properly. One of the following should clear this issue: 1) Kill all iexplore.exe processes, 2) logout, 3) reboot, 4) reinstall windows, 5) buy a new computer, 6) get a job at WalMart instead.

Typically you don't need to go past step 1)

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

GREAT,

thx everybody (Especially Psalty for cleaning up a bit. Authenticity, TY also for the tabbing :-)

@Dale : tip nr1 did it. But I figured that part out already. ty anyway.

now the script is running way better.

Just a question now.

Is there anything I can do so that it doesn't open 99% of the pages twice?

thx again everybody!!

Link to comment
Share on other sites

One of the following should clear this issue: 1) Kill all iexplore.exe processes, 2) logout, 3) reboot, 4) reinstall windows, 5) buy a new computer, 6) get a job at WalMart instead.

Typically you don't need to go past step 1)

Dale

Oh man... why didn't you say that before I got to step 6?! Now I'll have to keep the job as a greeter just to pay for the computer!

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

GREAT,

thx everybody (Especially Psalty for cleaning up a bit. Authenticity, TY also for the tabbing :-)

@Dale : tip nr1 did it. But I figured that part out already. ty anyway.

now the script is running way better.

Just a question now.

Is there anything I can do so that it doesn't open 99% of the pages twice?

thx again everybody!!

Go back to using the $f_Attach option in _IECreate(), and remember this time that the Warnings are normal (Errors are not) if it doesn't already exist.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Oh man... why didn't you say that before I got to step 6?! Now I'll have to keep the job as a greeter just to pay for the computer!

:P

Wow, I feel so bad... it was a joke PsaltyDS, a joke!

:-)

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
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
 Share

  • Recently Browsing   0 members

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