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 

Need script

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



Joined: 13 Mar 2010
Posts: 5

PostPosted: Sat Mar 13, 2010 9:59 pm    Post subject: Need script Reply with quote

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 Sad

It is my script:
Code:
loop
{
send {F1}
sleep 4500
}

mouseclick, right, 1259, 351


[Moved from Scripts & Functions forum. ~jaco0646]
Back to top
View user's profile Send private message
Murx
Guest





PostPosted: Sun Mar 14, 2010 6:05 am    Post subject: Reply with quote

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

PostPosted: Sun Mar 14, 2010 12:02 pm    Post subject: Reply with quote

Murx wrote:
Code:
#Persistent
SetTimer, PressF1, 500
Return

PressF1:
   Send {F1}
   Sleep, 4500
   MouseClick, Right, 1259, 351 ; better choose --> ControlClick
   Return
?

No Smile
It's script for active window, but need for turn window, that i can work with another window
Back to top
View user's profile Send private message
Murx
Guest





PostPosted: Sun Mar 14, 2010 2:32 pm    Post subject: Reply with quote

Quote:
; better choose --> ControlClick
There might be a reason for this hint! Right? Right! Wink
Back to top
Guest






PostPosted: Mon Mar 15, 2010 4:55 pm    Post subject: Reply with quote

I don't understand u :/
Back to top
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Mon Mar 15, 2010 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Murx
Guest





PostPosted: Mon Mar 15, 2010 7:54 pm    Post subject: Reply with quote

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

PostPosted: Tue Mar 16, 2010 8:38 pm    Post subject: Reply with quote

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 Smile
But i have else question.. My window don't have name.. What to me then to do?
Back to top
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Tue Mar 16, 2010 8:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
AdRenaL1n



Joined: 13 Mar 2010
Posts: 5

PostPosted: Tue Mar 16, 2010 9:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Tue Mar 16, 2010 9:15 pm    Post subject: Reply with quote

http://www.autohotkey.com/docs/LastFoundWindow.htm#class
_________________
"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
View user's profile Send private message Visit poster's website
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Tue Mar 16, 2010 11:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
AdRenaL1n



Joined: 13 Mar 2010
Posts: 5

PostPosted: Wed Mar 17, 2010 6:14 am    Post subject: Reply with quote

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 Surprised
big thx! Wink
Back to top
View user's profile Send private message
Display posts from previous:   
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