AutoHotkey Community

It is currently May 26th, 2012, 8:18 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Focus search box
PostPosted: June 20th, 2008, 7:42 pm 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
I would like to know how i can send the cursor inside the search box.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 7:52 pm 
Offline

Joined: June 16th, 2008, 12:26 pm
Posts: 82
Location: Pittsburgh, Pennsylvania, USA
Code:
GuiControl, Focus, SearchBoxName


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 8:43 pm 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
how I can get Searchbox name


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 8:43 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Use the WindowSpy included with AHK


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 8:46 pm 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 8:51 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 8:59 pm 
Offline

Joined: February 18th, 2008, 8:26 pm
Posts: 442
In addition to what Krogdor said you can also send Ctrl+K to Firefox to focus on search field.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 9:10 pm 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
How i can send Ctrl+K to firefox?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 9:11 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
ControlSend


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 9:30 pm 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
Well Ctrl+K goes to top right search box.
i want on the website.I guess I better of using position.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 9:54 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
there are other ways to do it. search the forum for using javascript to set focus. or, look at iMacros for firefox.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 2:37 am 
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


Report this post
Top
  
Reply with quote  
 Post subject: thank you
PostPosted: June 21st, 2008, 4:26 am 
Offline

Joined: June 18th, 2008, 3:00 pm
Posts: 69
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.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, poserpro, RaptorX, sjc1000 and 62 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