 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AdRenaL1n
Joined: 13 Mar 2010 Posts: 5
|
Posted: Sat Mar 13, 2010 9:59 pm Post subject: Need script |
|
|
Hi all
The script on button F1 pressing is necessary each 5 seconds, but still it is necessary that the script worked with the curtailed window
How it is possible to make?
Sorry for my english. I'm russian. Rus FAQ don't work
It is my script: | Code: | loop
{
send {F1}
sleep 4500
}
mouseclick, right, 1259, 351 |
[Moved from Scripts & Functions forum. ~jaco0646] |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Sun Mar 14, 2010 6:05 am Post subject: |
|
|
| Code: | #Persistent
SetTimer, PressF1, 500
Return
PressF1:
Send {F1}
Sleep, 4500
MouseClick, Right, 1259, 351 ; better choose --> ControlClick
Return | ? |
|
| Back to top |
|
 |
AdRenaL1n
Joined: 13 Mar 2010 Posts: 5
|
Posted: Sun Mar 14, 2010 12:02 pm Post subject: |
|
|
| Murx wrote: | | Code: | #Persistent
SetTimer, PressF1, 500
Return
PressF1:
Send {F1}
Sleep, 4500
MouseClick, Right, 1259, 351 ; better choose --> ControlClick
Return | ? |
No
It's script for active window, but need for turn window, that i can work with another window |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Sun Mar 14, 2010 2:32 pm Post subject: |
|
|
| Quote: | | ; better choose --> ControlClick | There might be a reason for this hint! Right? Right!  |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 15, 2010 4:55 pm Post subject: |
|
|
| I don't understand u :/ |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 780 Location: England
|
Posted: Mon Mar 15, 2010 7:41 pm Post subject: |
|
|
Do you want to be able to send something to one window that is not active (or minimised), and still be able to click in another window that is active?
Try the below, open notepad and minimise it. Then start the script. It will right click at the co-ordinates you put, but also will put some text to the notepad window.
Wait 10-15 seconds, then maximise the Notepad window, and you will see that it has the text in there.
Is this what you meant?
| Code: | #NoEnv
#Persistent
SetTitleMatchMode, 2
WindowName := "Notepad" ; CHANGE YOUR WINDOW NAME HERE
SetTimer, SendF1, 5000 ; this will send F1 to an active (or inactive/minimised) window every 5 seconds
Click, right, 1259, 351 ; this will just right click, it doesn't matter which window is active
Return
SendF1:
ControlSend,, hello{ENTER}, %WindowName%
Return
Esc::ExitApp |
|
|
| Back to top |
|
 |
Murx Guest
|
Posted: Mon Mar 15, 2010 7:54 pm Post subject: |
|
|
| Quote: | | I don't understand u :/ | Because I read the AHK manual and you didn't ? Right? Right. |
|
| Back to top |
|
 |
AdRenaL1n
Joined: 13 Mar 2010 Posts: 5
|
Posted: Tue Mar 16, 2010 8:38 pm Post subject: |
|
|
| OceanMachine wrote: | Do you want to be able to send something to one window that is not active (or minimised), and still be able to click in another window that is active?
Try the below, open notepad and minimise it. Then start the script. It will right click at the co-ordinates you put, but also will put some text to the notepad window.
Wait 10-15 seconds, then maximise the Notepad window, and you will see that it has the text in there.
Is this what you meant?
| Code: | #NoEnv
#Persistent
SetTitleMatchMode, 2
WindowName := "Notepad" ; CHANGE YOUR WINDOW NAME HERE
SetTimer, SendF1, 5000 ; this will send F1 to an active (or inactive/minimised) window every 5 seconds
Click, right, 1259, 351 ; this will just right click, it doesn't matter which window is active
Return
SendF1:
ControlSend,, hello{ENTER}, %WindowName%
Return
Esc::ExitApp |
|
oh, big thx
But i have else question.. My window don't have name.. What to me then to do? |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Tue Mar 16, 2010 8:47 pm Post subject: |
|
|
Use ahk_class or ahk_id intead. _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
AdRenaL1n
Joined: 13 Mar 2010 Posts: 5
|
Posted: Tue Mar 16, 2010 9:04 pm Post subject: |
|
|
| MasterFocus wrote: | | Use ahk_class or ahk_id intead. |
ahk_class of my programm is "1234" (for example)
Instead of windowname write "1234"?
WindowName := "1234"
or no? |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 780 Location: England
|
Posted: Tue Mar 16, 2010 11:19 pm Post subject: |
|
|
Try like this
| Code: | #NoEnv
#Persistent
SetTitleMatchMode, 2
SetTimer, SendF1, 5000 ; this will send F1 to an active (or inactive/minimised) window every 5 seconds
Click, right, 1259, 351 ; this will just right click, it doesn't matter which window is active
Return
SendF1:
ControlSend,, {F1}, ahk_class 1234 ; CHANGE CLASS HERE
Return
Esc::ExitApp |
|
|
| Back to top |
|
 |
AdRenaL1n
Joined: 13 Mar 2010 Posts: 5
|
Posted: Wed Mar 17, 2010 6:14 am Post subject: |
|
|
| OceanMachine wrote: | Try like this
| Code: | #NoEnv
#Persistent
SetTitleMatchMode, 2
SetTimer, SendF1, 5000 ; this will send F1 to an active (or inactive/minimised) window every 5 seconds
Click, right, 1259, 351 ; this will just right click, it doesn't matter which window is active
Return
SendF1:
ControlSend,, {F1}, ahk_class 1234 ; CHANGE CLASS HERE
Return
Esc::ExitApp |
|
Its work
big thx!  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|