AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Run, http://... results in an error

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
AGU
Guest





PostPosted: Sun Jun 10, 2007 12:11 am    Post subject: Run, http://... results in an error Reply with quote

When running the following little script, Autohotkey reports an error:

Code:
Run, http://www.autohotkey.com


Quote:
---------------------------
R2323543.ahk
---------------------------
Error: Failed attempt to launch program or document:
Action: <http://www.autohotkey.com>
Params: <>

The current thread will exit.

Specifically: Das System kann die angegebene Datei nicht finden. (AGU: file can't be found)



Line#
---> 001: Run,http://www.autohotkey.com
002: Exit
002: Exit

---------------------------
OK
---------------------------


However my preferred browser opens up and displays the page.

My AHK Version is 1.0.46.17. What am I doing wrong?
___________________________
Cheers AGU
Back to top
sanitarium



Joined: 08 Jun 2007
Posts: 28

PostPosted: Sun Jun 10, 2007 4:01 am    Post subject: Reply with quote

It doesn't produce an error here. Could you please provide a bit more information about your system?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sun Jun 10, 2007 6:49 am    Post subject: Reply with quote

I am not able to reproduce it.. Maybe adding a trailing slash should help.
Somewhat, a related post: AHK fails to run some url shortcuts by Rajat

Smile
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Sun Jun 10, 2007 9:21 am    Post subject: Reply with quote

Try passing it as an arg, i.e. Run, firefox http://www.google.com
_________________

Back to top
View user's profile Send private message Visit poster's website
AGU
Guest





PostPosted: Sun Jun 10, 2007 1:27 pm    Post subject: Reply with quote

Grumpy wrote:
Could you please provide a bit more information about your system?
Well, I'm running W2k SP4. AHK Version is 1.0.46.17.
System default browser is Firefox 2.0.0.3 but IE and Opera are installed too.
Anything else?

Skan wrote:
Maybe adding a trailing slash should help.
Thanks. I'll give it a try.

Titan wrote:
Try passing it as an arg, i.e. Run, firefox http://www.google.com
Well, I would have tried it already, but that's no option here. Maybe I'll have to say s.th about the background. Wink

I'm currently rewriting the 'CheckForUpdates' routine for BBCodeWriter.
Code:
CheckForUpdate:
  MsgBox, 8228, %lang_gui1_TtlMsgCheckUpdates%, %lang_gui1_MsgCheckUpdates%
  IfMsgBox, Yes
    {
      URLDownloadToFile, http://autohotkey.net/~AGermanUser/BBCodeWriter/version.txt, %A_ScriptDir%\version.txt
      FileRead, InternetVersion, %A_ScriptDir%\version.txt   

      MsgBox, 8228, %lang_gui1_TtlMsgCheckUpdates%
      ,%lang_gui1_MsgCurrent%`t%InternetVersion%`n`n%lang_gui1_MsgLocal%`t%Version%`n`n%lang_gui1_MsgUpdateVisit%
      IfMsgBox, Yes
        GoSub, ForumLink
    }
Return

It's working perfectly. As you see, after clickling "Yes" in the last MsgBox, BBCodeWriter gosubs to "ForumLink", which looks like this:
Code:
ForumLink:
  If LangPrfx = en
    Run, http://www.autohotkey.com/forum/topic6161.html
  If LangPrfx = de
    Run, http://de.autohotkey.com/forum/topic30.html
Return

And this is where the error occures. As I don't know the users default browser I can't pass the URLs as args. Assuming I would pass it as args, would require e.g. a firefox installation with your example code. Smile
______________________
Cheers AGU
Back to top
Normand



Joined: 21 May 2007
Posts: 37

PostPosted: Sun Jun 10, 2007 1:39 pm    Post subject: Reply with quote

I have a link to autohotkey.com in a AHK GUI and it works well.

Instead of:
http://www.autohotkey.com

Try:
http://www.autohotkey.com/

The final / is facultative for browsers because they are error tolerant. Without a final /, the string "www.autohotkey.com" have to be interpret like a file name instead of a domain name. And that's why your browser add it automatically when you don't.

So, in my humble opinion, it is due to a html error, not to an AHK bug.
_________________
Normand Lamoureux


Last edited by Normand on Sun Jun 10, 2007 4:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Sun Jun 10, 2007 4:13 pm    Post subject: Reply with quote

AGU wrote:
As I don't know the users default browser I can't pass the URLs as args.


Code:
url=http://www.google.co.uk/

RegRead, DefaultBrowser, HKEY_CLASSES_ROOT,http\shell\open\command
StringTrimRight, DefaultBrowser, DefaultBrowser, (StrLen(DefaultBrowser)-InStr(DefaultBrowser, ".exe"))-4
StringReplace,DefaultBrowser,DefaultBrowser,",,all

IfExist, %DefaultBrowser%
  Run, %DefaultBrowser% "%url%"
Else
  Run, iexplore.exe "%url%"
Return
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group