Discussion:
[power-pro] Simple way to have window go to same position each time?
frewsax@yahoo.com [power-pro]
2017-12-11 02:34:52 UTC
Permalink
Hello,
I'm wondering if there's an easy way to have a window (that I open with a hotkey)
be positioned at a certain place each time it opens.

For example, I have set up w+v to open D:\
I would like each time window D:\ is opened to be have this position: (x,y, width,height)
720, 10, 540, 970

At Edit hot key/ mouse action I've tried various combinations of
*Window Position 10 30 100 200 autorun
but I do not understand autorun, etc.

I'm thinking there may be a simple way to just put in
x,y, width,height somewhere in the Edit hot key/ mouse action dialog.

My goal here is whenever I do w+v to open D:\, that the window D:\ will always
go to that same position 720, 10, 540, 970.

By the way, Windows 10 is not remembering the window positions, so I'm
hoping to find a way for PowerPro to do it.

Thanks for any ideas.
brucexs@yahoo.com [power-pro]
2017-12-11 09:44:21 UTC
Permalink
The window command in the more commands box of the hot key is the right idea.

But there are two challenges.
The first challenge is that you have to identify the window you want moved to PowerPro somehow. There has to be some way to tell powerpro which window to move. If the window always has a know part of the caption you can use that. For example, Notepad captions always end in Notepad, so you can use *notepad. Or you can use the exename preceded by an = as in =notepad or =winword (for ms word). See help, index "caption lists" for details.


The second challenge is that many programs take time to open, and you have to allow for that before issuing the window move command. The win.forinterval(number) should therefore precede the window move command in the move commands.


So for starting and moving notepad, the command entry would be


Command notepad
More Commands
wait.forinterval(250)
window position 10 50 300 200 *notepad


Note: you may need to change the wait interval to something longer than 250 ms. Of course, you will need to change the position numbers and the caption.


The autorun is another way to specify the window to be moved. It is used in conjunction with autorun command lists. See help index, auto run commands when window opens


BTW, it is not Windows that remembers the last position of a program's window. Each program must do that for itself, Some do, some don't.
frewsax@yahoo.com [power-pro]
2017-12-11 16:54:01 UTC
Permalink
Thanks so much for the help.

Yes this works fine now.

My goal here is to have a hotkey open a regular explorer folder as a new window
as I'm opening various folders on my hard drive. And also to be able to count on
the window to go to the same position each time it is opened. This really helps
my workflow when it happens like this. So this does the trick!

example:

Command:
C:\
More Commands:
wait.forinterval(500)
window position 2 2 540 980 C:\

By the way, I like how the above will only affect window C:\
but not affect, for example, window C:\Program Files.
I guess it's like an exact match kind of thing.

I love this program!

Thanks again!
brucexs@yahoo.com [power-pro]
2017-12-11 18:53:34 UTC
Permalink
If you are going to do this with many different programs, you may want to try auto run for that. That works regardless of how the program is started.

It can be an exact match. Or a partial match if you use a * (just like Windows wildcards in file names).


So if you used C:\* instead of just C:\, it would affect any folder on c: but not d:
frewsax@yahoo.com [power-pro]
2017-12-13 00:10:10 UTC
Permalink
Okay thanks.
I may look into autorun, but at this time it seems a bit complex for me.
I'm able to get my folders to open consistently in the same place each time,
with the hotkeys I have set up, so I'm is achieving my goal for now.
Thanks again for the autorun idea for me to consider.
brucexs@yahoo.com [power-pro]
2017-12-13 11:48:38 UTC
Permalink
Great. I'm glad PPro is doing all you need. But if you ever think:

"I'd like to be able to run these PowerPro commands whenever of window like this opens",

then you should look at auto run.

Loading...