AutoHotkey Community

It is currently May 27th, 2012, 5:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Need script
PostPosted: March 13th, 2010, 10:59 pm 
Offline

Joined: March 13th, 2010, 10:56 pm
Posts: 5
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 7:05 am 
Code:
#Persistent
SetTimer, PressF1, 500
Return

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 1:02 pm 
Offline

Joined: March 13th, 2010, 10:56 pm
Posts: 5
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 3:32 pm 
Quote:
; better choose --> ControlClick
There might be a reason for this hint! Right? Right! :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 5:55 pm 
I don't understand u :/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 8:41 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 8:54 pm 
Quote:
I don't understand u :/
Because I read the AHK manual and you didn't ? Right? Right.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 9:38 pm 
Offline

Joined: March 13th, 2010, 10:56 pm
Posts: 5
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 9:47 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
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.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 10:04 pm 
Offline

Joined: March 13th, 2010, 10:56 pm
Posts: 5
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 10:15 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
http://www.autohotkey.com/docs/LastFoun ... .htm#class

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 12:19 am 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 7:14 am 
Offline

Joined: March 13th, 2010, 10:56 pm
Posts: 5
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 :o
big thx! :wink:


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: Apollo, Google Feedfetcher, mrhobbeys, rbrtryn and 56 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