Autohotkey to create separate windows

328 views
Skip to first unread message

Andrei

unread,
May 18, 2013, 7:28:26 PM5/18/13
to mylifeo...@googlegroups.com
Hello !

I have placed on the desktop many separate MLO windows (i used F3 key to create them).

When i relaunch MLO, i shall recreate all those windows manually.
If somebody knows how to create them with a script, please help.

Thank you
Best regards,
Andrew


Andrei

unread,
May 19, 2013, 5:07:59 AM5/19/13
to mylifeo...@googlegroups.com
Here is the script to create a separate window using AHK:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^F3::
Run "X:\MLO portable\MLO.exe" "X:\Dropbox\MLO\test.ml"
IfWinNotActive, MyLifeOrganized ahk_class TfrmMyLifeMain, , WinActivate, MyLifeOrganized ahk_class TfrmMyLifeMain
WinWaitActive, MyLifeOrganized ahk_class TfrmMyLifeMain
SendInput, ^!+t
SendInput, ^!o
SendInput, {F3}
return


How does the code work:
Run........ runs the portable mlo.exe located on disk "X:\..." and opens the test.ml file
IfWinNotActive....... set MLO window active
WinWait....... waiting MLO window to become active
SendInput, ^!+t................. select a tab by pressing its hotkey Ctrl+Alt+Shift+T (the hotkeys must be defined in the MLO application before running the script)
SendInput, ^!o.................. select a view by pressing its hotkey Ctrl+Alt+O
SendInput, {F3}................ Open the view into a new window

I gues the above rows can be multiplied to open many windows.





воскресенье, 19 мая 2013 г., 2:28:26 UTC+3 пользователь Andrei написал:

Andrei

unread,
May 19, 2013, 3:39:32 PM5/19/13
to mylifeo...@googlegroups.com
here is an updated example. the script opens several windows and arranges them on the desktop.



#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
;SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


; FUNCTIONS
ResizeWin(xpos = 0, ypos = 0,width = 0,height = 0)
    {
        WinGetPos,X,Y,W,H,A
        WinMove,A,,%xpos%,%ypos%,%width%,%height%
  }

 
   
^F3::
Run "X:\MLO portable\MLO.exe" "X:\Dropbox\MLO\MLO.ml"

; open help window
WinWaitActive, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain
SendInput, ^!+h
SendInput, ^!g
SendInput, {F3}
Sleep, 500
ResizeWin(3,3,234,261)

;open Hierarchy tree
IfWinNotActive, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain, , WinActivate, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain
WinWaitActive, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain
SendInput, ^!+o
SendInput, ^{Numpad9}
SendInput, {F3}
Sleep, 500
ResizeWin(3,266,234,601)

;open Review window
IfWinNotActive, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain, , WinActivate, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain
WinWaitActive, MLO.ml - MyLifeOrganized ahk_class TfrmMyLifeMain
SendInput, ^!+o
SendInput, ^{Numpad3}
SendInput, {F3}
Sleep, 500
ResizeWin(241,3,760,463)

return



to get the window coordinates and ahk_class i used "AutoIt3 Window Spy" application which comes with Autohotkey
Best regards,
Andrew



воскресенье, 19 мая 2013 г., 2:28:26 UTC+3 пользователь Andrei написал:
Hello !

Andrei

unread,
May 20, 2013, 4:34:31 PM5/20/13
to mylifeo...@googlegroups.com

An example of windows generated, resized and positioned by AHK.



воскресенье, 19 мая 2013 г., 2:28:26 UTC+3 пользователь Andrei написал:
Hello !

Lisa Stroyan

unread,
May 20, 2013, 5:00:32 PM5/20/13
to Group, MyLifeOrganized
Wow, that looks very cool. 

Do you use a second monitor or some sort of desktop workspace-manager? Ie, do you have a second virtual "screen" to hold all these windows?




--
You received this message because you are subscribed to the Google Groups "MyLifeOrganized" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mylifeorganiz...@googlegroups.com.
To post to this group, send email to mylifeo...@googlegroups.com.
Visit this group at http://groups.google.com/group/mylifeorganized?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Lisa


Lisa Stroyan, mailto: lstr...@gmail.com

Andrei

unread,
May 21, 2013, 3:21:33 AM5/21/13
to mylifeo...@googlegroups.com
Hi Lisa,

I use a free workspace manager http://virtuawin.sourceforge.net/
It has many settings + additional modules. The most important thing is that this application is stable and works as designed.

My configuration:
I have 4 workspaces (virtual desktops).
First desktop is for tasks which i do right now.
The second desktop holds all those MLO windows + timers. All windows are opened, resized and positiond by AHK. So, i just click a shortcut on a clean desktop, and in a few seconds it will be populated with the windows.
Third desktop holds MLO main app.
Fourth windows holds the apps which may run in the background. For example, downloading something. Converting video files and so on.

Moving of the windows between workspaces can be done with shortcuts.
Here is a picture of my hotkey settings:


Please create a System Restore Point before you install this application.
The app is portable, so it is safe to run. However, if you decide to choose another desktop manager, then this Restore Point may be useful.

Best regards
Andrew

вторник, 21 мая 2013 г., 0:00:32 UTC+3 пользователь Lisa S написал:
Lisa Stroyan, mailto: ...@gmail.com

Andrei

unread,
May 21, 2013, 3:31:59 AM5/21/13
to mylifeo...@googlegroups.com

The picture has not been uploaded correctly. Here it is:

BR
Andrew

вторник, 21 мая 2013 г., 10:21:33 UTC+3 пользователь Andrei написал:

Lisa Stroyan

unread,
May 21, 2013, 9:46:39 AM5/21/13
to Group, MyLifeOrganized
Thanks! That looks like something I would find quite useful. It's probably got a lighter footprint than the google one I tried a while back. (I'm on a rather puny laptop running Vista). 

On Tue, May 21, 2013 at 1:21 AM, Andrei <bacean...@gmail.com> wrote:
I use a free workspace manager http://virtuawin.sourceforge.net/
It has many settings + additional modules. The most important thing is that this application is stable and works as designed.




--
Lisa


Lisa Stroyan, mailto: lstr...@gmail.com
Reply all
Reply to author
Forward
0 new messages