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 

Clipboard/Searching Websites etc

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



Joined: 28 Apr 2004
Posts: 373

PostPosted: Mon Jul 05, 2004 5:57 pm    Post subject: Clipboard/Searching Websites etc Reply with quote

Hi, I've put together a script using AHK that helps to research items in HijackThis logs and put a compiled version up on my websites.

There is more information on that webpage but the way it works is to copy a word that is selected in a log file and search for it on the webs or in a text file.

here is an example of one of a log files-
http://forums.spywareinfo.com/index.php?showtopic=13093

A couple people have reported a problem with not running or nothing being copied to the cipboard (and so getting the error that the wait timed out)

I think the problem is with this part of the code. I've used to option to search google as an example.

Code:


;>>>>>>>>>>>>>>>>>>> Search Google

hotkeys:

^g::

clipboard=

    Send, ^c

ClipWait, 2
if ErrorLevel <> 0
{
MsgBox, The attempt to copy text onto the clipboard failed, please try again.
clipboard =
   return

}

    word = %clipboard%

outvar = http://www.google.co.uk/search?q=%word%&ie=UTF-8&oe=UTF-8&hl=en&meta=

gosub, runwebsite


EXIT




Code:

runwebsite:

;Works out which browsers is running to make sure that the website opens in a new window.

IfWinExist, ahk_class IEFrame
{
  Run iexplore.exe "%outvar%"

gosub, splashoff

  EXIT
}


WinGetTitle, browsertitle, A
StringRight, browsertitle, browsertitle, 7

IfInString, browsertitle, Opera
{
  Run opera.exe "%outvar%"

return
}

IfWinExist, ahk_class MozillaWindowClass
{

IfInString, browsertitle, Firefox
{
  Run firefox.exe "%outvar%"

return
}

IfInString, browsertitle, Mozilla
{
  Run mozilla.exe "%outvar%"

return
}

}

else
{

Run %outvar%

return
}


It might be easier to make a version that only runs with Internet explorer installed in these two cases. I don't think the "Run %outvar%" part is working properly-

http://forums.spywareinfo.com/index.php?showtopic=2329&st=0&#entry48400

Same here and he also seems to be having trouble with avant being his default browsers-
http://forums.net-integration.net/index.php?showtopic=17161

I've got no idea what is wrong here-
http://forums.net-integration.net/index.php?showtopic=19145

Let me know if you need a copy of the whole code and I'll e-mail it to you (it's got quite long).

It could just be a problem at there end. I know quite alot of people have used it without problems. I just wondered if there was something I could change in the code to make it more reliable.

Thanks, Jon

EDIT:
You might not be able to access the first link but it is a similar problem to the second

I had to try and get it to detect which browser was being used to make sure the website opens in a new window.
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Mon Jul 05, 2004 7:42 pm    Post subject: Reply with quote

I don't see any obvious problems with the script. If the user presses a hotkey that uses ^c but there's no text selected (or the target window isn't active), nothing will be copied to the clipboard.

Also, the Run command will probably do nothing if the target to be run is blank. You could add code to check if the variable is blank and display a warning dialog.

If you ever find some specific and repeatable misbehavior, I'll research it as a potential bug.
Back to top
View user's profile Send private message Send e-mail
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Mon Jul 05, 2004 8:14 pm    Post subject: Reply with quote

Thanks alot for looking over it for me. It just seemed odd that three people had very similar problems.

I'll add something to check if the clipboard is empty and add something to activate the window before the text is copied.

I'll let you know if others have the same problem. It does only seem to be in a very small number of cases compared to the number of people who use it.

Thanks for your time, Jon
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