ie.Navigate("%clipboard%") not working, how to fix?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Cuadrix
Posts: 224
Joined: 07 May 2017, 08:26

ie.Navigate("%clipboard%") not working, how to fix?

26 May 2017, 11:25

I have a code which upon start lets you select a text file to read. After selecting the text the script reads the text file line by line, and each time saves the current line to clipboard. My problem is that when I put %clipboard% or the variable name %LinkURL%, it doesn't navigate to the link stored in clipboard. Nothing happens, but when I write any other text without %% then it navigates. Any help would be appreciated. Here's my code:

Code: Select all

#SingleInstance force
#notrayicon

Start:
SetWorkingDir %A_ScriptDir% 
FileSelectFile, file,,, Select your Link text file, Data File (*.txt)
FileRead, fileData, %file%
If ErrorLevel = 1 
{   Msgbox, 5,No file to work with..?, You must choose a file to read! ; If no file was chosen, show message box offering a retry or cancel option.
   IfMsgBox Retry
          Goto Start 
   else
          MsgBox,,Bye!,OK, see you soon! ;
   ExitApp
}   
; Init lineIndex to 1
lineIndex := 1

KeyWait, F3
F3::
    Loop, Parse, fileData, `n
    {
        ; A_Index holds the current loop-itteration
        if (A_Index == lineIndex) {
            clipboard = %A_LoopField%

LinkURL = %clipboard%

;ComObjError(false)

App2IE(URL)
{
	For ie in ComObjCreate( "Shell.Application" ).Windows
		If InStr(ie.FullName, "iexplore.exe" ) && InStr(ie.LocationURL, URL)
			Return ie
}
ie := App2IE(URL)
ie.Visible := True
y = 8
loop, 2
{
	ie.Navigate("%LinkURL%")
		y++
}
break
        }
    }
return

~Esc::ExitApp
----
User avatar
Cuadrix
Posts: 224
Joined: 07 May 2017, 08:26

Re: ie.Navigate("%clipboard%") not working, how to fix?

26 May 2017, 11:50

I tried it without quotation marks but it still didn't work
----
User avatar
Cuadrix
Posts: 224
Joined: 07 May 2017, 08:26

Re: ie.Navigate("%clipboard%") not working, how to fix?

26 May 2017, 11:58

Hey, never mind. I fixed it.
----

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], FanaticGuru, RyantheCoder, vanil and 47 guests