App or a Script to open programs in fixed size

gardenman

Commendable
Herald
Jun 16, 2016
34
0
1,660
18
Hi, this can be done with AutoHotKey. Download it from the blue/white button here: https://autohotkey.com/download/ and install it. In order for AHK to work, you will need to provide it a script. Scripts can be created in Notepad and save the file with an .ahk file extension. For example: MyScript.ahk

I don't have the same software installed that you do so I can't create the exact script for you, however I will show you an example that I think you can work with (depending on your level of computer knowledge).

I created a script that opens Notepad, 7-Zip, and 2 tabs in Edge. I had some trouble with the WinMove function but eventually got it figured out and I left plenty of comments in my script which may help you out. Here is the script that I created:


SetTitleMatchMode, 2

; Run your programs here, Edge will open with 2 tabs open.
Run, C:\program files\7-zip\7zfm.exe
Run, notepad.exe
Run, microsoft-edge:http://www.tomshardware.com/
Run, microsoft-edge:http://www.google.com/

; Notepad - Activate it and set it Window position and size.
Sleep, 200
WinActivate, Notepad
Sleep, 200
WinMove, A, , 1, 1, 400, 400

; 7-Zip File Manager
; If the Window won't move as normal, find it's PID and move it that way.
; Info from: https://autohotkey.com/board/topic/80690-winmove-not-working-options/
Sleep, 200
Process, exist, 7ZFM.exe
WinMove, ahk_pid %errorlevel%,, 1, 401, 400, 320

; Edge
; Sometimes AHK can't find a Window by it's title so you can use it's
; classname. See the WinSpy program included with AutoHotKey to find
; out the classname of Windows.
Sleep, 200
WinActivate, ahk_class ApplicationFrameWindow
Sleep, 200
WinMove, ahk_class ApplicationFrameWindow,, 401, 1, 620, 720



And here are the results of running the script:

Tip: After you have created your script, you can "convert" it to an EXE file by right clicking on it and choosing Compile Script. Afterwards, the .ahk file is no longer needed. You can even run the MyScript.exe if AutoHotKey is not installed.

If you try this you will likely have to experiment with it and change things around. Good luck.
 

gardenman

Commendable
Herald
Jun 16, 2016
34
0
1,660
18
Hi, this can be done with AutoHotKey. Download it from the blue/white button here: https://autohotkey.com/download/ and install it. In order for AHK to work, you will need to provide it a script. Scripts can be created in Notepad and save the file with an .ahk file extension. For example: MyScript.ahk

I don't have the same software installed that you do so I can't create the exact script for you, however I will show you an example that I think you can work with (depending on your level of computer knowledge).

I created a script that opens Notepad, 7-Zip, and 2 tabs in Edge. I had some trouble with the WinMove function but eventually got it figured out and I left plenty of comments in my script which may help you out. Here is the script that I created:


SetTitleMatchMode, 2

; Run your programs here, Edge will open with 2 tabs open.
Run, C:\program files\7-zip\7zfm.exe
Run, notepad.exe
Run, microsoft-edge:http://www.tomshardware.com/
Run, microsoft-edge:http://www.google.com/

; Notepad - Activate it and set it Window position and size.
Sleep, 200
WinActivate, Notepad
Sleep, 200
WinMove, A, , 1, 1, 400, 400

; 7-Zip File Manager
; If the Window won't move as normal, find it's PID and move it that way.
; Info from: https://autohotkey.com/board/topic/80690-winmove-not-working-options/
Sleep, 200
Process, exist, 7ZFM.exe
WinMove, ahk_pid %errorlevel%,, 1, 401, 400, 320

; Edge
; Sometimes AHK can't find a Window by it's title so you can use it's
; classname. See the WinSpy program included with AutoHotKey to find
; out the classname of Windows.
Sleep, 200
WinActivate, ahk_class ApplicationFrameWindow
Sleep, 200
WinMove, ahk_class ApplicationFrameWindow,, 401, 1, 620, 720



And here are the results of running the script:

Tip: After you have created your script, you can "convert" it to an EXE file by right clicking on it and choosing Compile Script. Afterwards, the .ahk file is no longer needed. You can even run the MyScript.exe if AutoHotKey is not installed.

If you try this you will likely have to experiment with it and change things around. Good luck.
 
Thread starter Similar threads Forum Replies Date
H Apps General Discussion 1
ExtreamChaozZ Apps General Discussion 6
D Apps General Discussion 5
V Apps General Discussion 1
D Apps General Discussion 3
packersfan036 Apps General Discussion 4
S Apps General Discussion 1
SyncroScales Apps General Discussion 4
A Apps General Discussion 1
Tom Waller Apps General Discussion 2
tarmiricmi Apps General Discussion 5
C Apps General Discussion 6
T Apps General Discussion 5
C Apps General Discussion 9
A Apps General Discussion 2
V Apps General Discussion 2
S Apps General Discussion 9
N Apps General Discussion 3
W Apps General Discussion 1
M Apps General Discussion 1

ASK THE COMMUNITY

TRENDING THREADS