AutoHotkey Community

It is currently May 26th, 2012, 8:03 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 12th, 2009, 10:47 pm 
Offline

Joined: December 17th, 2008, 2:33 am
Posts: 15
I have this part of my code here
Code:
Loop
{
    FileReadLine, line, %A_ScriptDir%/list.txt, %A_Index%
    if ErrorLevel
        break
    IE_LoadURL(pwb, %Line%)
    sleep, 3000
}

But it doesn't want to work I've tried for ages with numerous different ways but I feel I will go insane if I keep going, so I'm asking for help :)

Thank you in advance for any or all help.

FIXED


Last edited by Chevron on July 13th, 2009, 6:45 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2009, 12:02 am 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
did you include the Wrapper IEControl.ahk and CoHelper.ahk?
I think we need your whole code to see your mistake or the Problem


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2009, 6:33 am 
Offline

Joined: December 17th, 2008, 2:33 am
Posts: 15
Yea i did. Ok ill post the whole thing.
Code:
#Include IEControl.ahk
#Include CoHelper.ahk
#SingleInstance force



GoSub, GuiStart

Gui, +LastFound +Resize
Gui, Show, w800 h600 Center, WebBrowser
hWnd := WinExist()

CLSID_WebBrowser := "{8856F961-340A-11D0-A96B-00C04FD705A2}"
IID_IWebBrowser2 := "{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}"
pwb := CreateObject(CLSID_WebBrowser, IID_IWebBrowser2)

AtlAxAttachControl(pwb, hWnd)


Loop
{
    FileReadLine, line, %A_ScriptDir%/list.txt, %A_Index%
    if ErrorLevel
        break
    IE_LoadURL(pwb, %Line%)
    sleep, 3000
}

GuiStart:
AtlAxWinInit()
CoInitialize()
Return

GuiClose:
Gui, %A_Gui%:Destroy
Release(pwb)
CoUninitialize()
AtlAxWinTerm()
ExitApp


I'm working off the basic IEcontrol script.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 13th, 2009, 12:50 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Chevron wrote:
FIXED
It could be helpful to others if you mention how you fixed it. I suppose you removed the percent signs around the Line variable.

Btw, using FileReadLine to read an entire file is very inefficient, especially if the file is large.
Quote:
Generally, this command should be used only for small files, or in cases where only a single line of text is needed. To scan and process a large number of lines (one by one), use a file-reading loop for best performance.
Source: FileReadLine
Code:
Loop, Read, %A_ScriptDir%/list.txt
{
    IE_LoadURL(pwb, A_LoopReadLine)
    Sleep, 3000
}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google [Bot], Retro Gamer, wolverineks, Yahoo [Bot] and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group