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 

Focus search box

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



Joined: 18 Jun 2008
Posts: 69

PostPosted: Fri Jun 20, 2008 7:42 pm    Post subject: Focus search box Reply with quote

I would like to know how i can send the cursor inside the search box.
Back to top
View user's profile Send private message
trenton_xavier



Joined: 16 Jun 2008
Posts: 39
Location: Pittsburgh, Pennsylvania, USA

PostPosted: Fri Jun 20, 2008 7:52 pm    Post subject: Reply with quote

Code:

GuiControl, Focus, SearchBoxName
Back to top
View user's profile Send private message AIM Address
hay



Joined: 18 Jun 2008
Posts: 69

PostPosted: Fri Jun 20, 2008 8:43 pm    Post subject: Reply with quote

how I can get Searchbox name
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 860
Location: The Interwebs

PostPosted: Fri Jun 20, 2008 8:43 pm    Post subject: Reply with quote

Use the WindowSpy included with AHK
Back to top
View user's profile Send private message AIM Address
hay



Joined: 18 Jun 2008
Posts: 69

PostPosted: Fri Jun 20, 2008 8:46 pm    Post subject: Reply with quote

this is what I got
Code:

ahk_class MozillaUIWindowClass

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:   892, 278  (less often used)
In Active Window:   896, 282

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<
ClassNN:   MozillaWindowClass6


how i can send focus there?
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 860
Location: The Interwebs

PostPosted: Fri Jun 20, 2008 8:51 pm    Post subject: Reply with quote

Firefox is made up of only a few controls: one for each tab, and one for the menu bar area. Because of this, commands that use specific controls like ControlFocus, ControlGet, etc. will not really work.

So basically, you'll have to just click it or tab to it.
Back to top
View user's profile Send private message AIM Address
Oberon



Joined: 18 Feb 2008
Posts: 458

PostPosted: Fri Jun 20, 2008 8:59 pm    Post subject: Reply with quote

In addition to what Krogdor said you can also send Ctrl+K to Firefox to focus on search field.
Back to top
View user's profile Send private message
hay



Joined: 18 Jun 2008
Posts: 69

PostPosted: Fri Jun 20, 2008 9:10 pm    Post subject: Reply with quote

How i can send Ctrl+K to firefox?
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 860
Location: The Interwebs

PostPosted: Fri Jun 20, 2008 9:11 pm    Post subject: Reply with quote

ControlSend
Back to top
View user's profile Send private message AIM Address
hay



Joined: 18 Jun 2008
Posts: 69

PostPosted: Fri Jun 20, 2008 9:30 pm    Post subject: Reply with quote

Well Ctrl+K goes to top right search box.
i want on the website.I guess I better of using position.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jun 20, 2008 9:54 pm    Post subject: Reply with quote

there are other ways to do it. search the forum for using javascript to set focus. or, look at iMacros for firefox.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Adzie
Guest





PostPosted: Sat Jun 21, 2008 2:37 am    Post subject: Reply with quote

At a guess, I'd say that you might be creating a script to beat a paid to search scheme. If I'm right, let me know in this thread, I may already have an app that does that effectively.

Anyway, seeing as you want to focus on a search within a page, I'm assuming you want the script to make a search Idea
By looking at the source code for that page, you can determine the URL for the search, and then type that URL directly into the address bar and use it.

For example, Google (UK) source code is:
Code:
<form action="/search" name="f">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr valign="top">
<td width="25%">&nbsp;
</td>
<td align="center" nowrap="nowrap">
<input name="hl" value="en" type="hidden">
<input autocomplete="off" maxlength="2048" name="q" size="55" title="Google Search" value="">
<br><input name="btnG" value="Google Search" type="submit">


(I've broken that down into separate lines for readability)

The two red parts are what your main focus needs to be on.
The form action tells you the url of the search script.
The name="q" tells you what variable the search term is stored under.

From that, you can create the url:
Code:
www.google.co.uk/search?q=AutoHotKey
www.google.co.uk/search?q=AutoHotKey+Forums


Now, you can run that URL directly through AHK if you want. Of course, if you are trying to beat a paid to search scheme, you will also have to look for where to put your User ID in the URL, and need to have a referrer and a click through, otherwise your script will be detected.

Hope that helps,
Adzie
Back to top
hay



Joined: 18 Jun 2008
Posts: 69

PostPosted: Sat Jun 21, 2008 4:26 am    Post subject: thank you Reply with quote

I would like to thank you for all the ideas.I like firefox and don't intend to switch back to IE.positioning so far works for me.i thought there is easier command to position the cursor inside the text box,I guess not.thanks anyway.
Back to top
View user's profile Send private message
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