| View previous topic :: View next topic |
| Author |
Message |
hay
Joined: 18 Jun 2008 Posts: 69
|
Posted: Fri Jun 20, 2008 7:42 pm Post subject: Focus search box |
|
|
| I would like to know how i can send the cursor inside the search box. |
|
| Back to top |
|
 |
trenton_xavier
Joined: 16 Jun 2008 Posts: 39 Location: Pittsburgh, Pennsylvania, USA
|
Posted: Fri Jun 20, 2008 7:52 pm Post subject: |
|
|
| Code: |
GuiControl, Focus, SearchBoxName
|
|
|
| Back to top |
|
 |
hay
Joined: 18 Jun 2008 Posts: 69
|
Posted: Fri Jun 20, 2008 8:43 pm Post subject: |
|
|
| how I can get Searchbox name |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 860 Location: The Interwebs
|
Posted: Fri Jun 20, 2008 8:43 pm Post subject: |
|
|
| Use the WindowSpy included with AHK |
|
| Back to top |
|
 |
hay
Joined: 18 Jun 2008 Posts: 69
|
Posted: Fri Jun 20, 2008 8:46 pm Post subject: |
|
|
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 |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 860 Location: The Interwebs
|
Posted: Fri Jun 20, 2008 8:51 pm Post subject: |
|
|
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 |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Jun 20, 2008 8:59 pm Post subject: |
|
|
| In addition to what Krogdor said you can also send Ctrl+K to Firefox to focus on search field. |
|
| Back to top |
|
 |
hay
Joined: 18 Jun 2008 Posts: 69
|
Posted: Fri Jun 20, 2008 9:10 pm Post subject: |
|
|
| How i can send Ctrl+K to firefox? |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 860 Location: The Interwebs
|
Posted: Fri Jun 20, 2008 9:11 pm Post subject: |
|
|
| ControlSend |
|
| Back to top |
|
 |
hay
Joined: 18 Jun 2008 Posts: 69
|
Posted: Fri Jun 20, 2008 9:30 pm Post subject: |
|
|
Well Ctrl+K goes to top right search box.
i want on the website.I guess I better of using position. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Fri Jun 20, 2008 9:54 pm Post subject: |
|
|
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 |
|
 |
Adzie Guest
|
Posted: Sat Jun 21, 2008 2:37 am Post subject: |
|
|
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
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%">
</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:
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
|
Posted: Sat Jun 21, 2008 4:26 am Post subject: thank you |
|
|
| 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 |
|
 |
|