AutoHotkey Community

It is currently May 26th, 2012, 8:37 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: August 23rd, 2009, 11:54 pm 
I want to create a simple AHK script that automatically moves new windows to a certain screen location.

Specifically, any time I open a new window with a given char string in the title (or even any new window for that matter), I want it to appear at a certain screen coord while the script is running.

Help!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 12:12 am 
Offline

Joined: August 12th, 2009, 6:07 pm
Posts: 26
Check out WinMove

Code:
Run, calc.exe
WinWait, Calculator
WinMove, 0, 0 ; Move the window found by WinWait to the upper-left corner of the screen.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 3:25 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Code:
Loop ; this will move any newly active windows with the word "Torrent" in their titles to the top of the screen
{
   SetTitleMatchMode, 2 ; allows window titles to match if the string appears anywhere in the title
   WinWaitActive, Torrent
   Sleep 20
   WinMove, % A_ScreenWidth // 2, 0
   WinWaitNotActive
}

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, joetazz, Leef_me, Mickers, tidbit, tomoe_uehara and 54 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