Posts: 64
Threads: 19
Joined: Nov 2012
I use a program called Screenpresso. It can run a command that captures the screen from certain coordinates. I would like to be able to capture the mouse coordinates and then fill them in my command. The normal command looks like this.
screenpresso.exe -captureregion "D:\Test\test2.jpg" 0;0;1280;720
It is at 0;0 where I would like to insert the mouse coordinates. Can someone show a macro that could do this? Thanks
Posts: 1,338
Threads: 61
Joined: Jul 2006
02-08-2019, 04:39 AM
(This post was last modified: 02-08-2019, 04:47 AM by Kevin.)
something like this should work for ya
str x=59
str y=100
str s="screenpresso.exe -captureregion ''D:\Test\test2.jpg'' 0;0;1280;720"
s.replacerx("(\d+;\d+)" F"{x};{y}" 4)
out s
Posts: 64
Threads: 19
Joined: Nov 2012
02-08-2019, 05:44 AM
(This post was last modified: 02-08-2019, 06:08 AM by pctechtv.)
Hi, thanks for the reply. From what you show I think I will be able to get it. What I wanted was where the mouse on the screen is to become the X and Y. Then I want quickmacros to run the command like from a command line (command prompt). Thanks
This does the trick. Your help was tremedous! Thanks
int px(xm) py(ym)
;str x=59
;str y=100
str s="screenpresso.exe -captureregion ''D:\Test\test2.jpg'' 0;0;640;360"
s.replacerx("(\d+;\d+)" F"{px};{py}" 4)
out s
RunConsole2 s
Posts: 64
Threads: 19
Joined: Nov 2012
02-08-2019, 07:10 PM
(This post was last modified: 02-08-2019, 07:18 PM by pctechtv.)
I use a timestamp like this. How could I also replace the test2.jpg to 1902081409.jpg (that being the current timestamp). Thanks
DateTime t.FromComputerTime
str sf=t.ToStrFormat("{yyMMdd}{HHmm}")
key (sf)
Is this the bestway?
int px(xm) py(ym)
DateTime t.FromComputerTime
str sf=t.ToStrFormat("{yyMMdd}{HHmm}")
str s="screenpresso.exe -captureregion ''D:\Test\test2.jpg'' 0;0;1280;720"
s.replacerx("(\d+;\d+)" F"{px};{py}" 4)
s.replacerx("(test2)" F"{sf}" 4)
out s
RunConsole2 s
Posts: 1,338
Threads: 61
Joined: Jul 2006
much simpler way replacerx is not needed
int px(xm) py(ym)
DateTime t.FromComputerTime
str sf=t.ToStrFormat("{yyMMdd}{HHmm}")
str s=F"screenpresso.exe -captureregion ''D:\Test\{sf}.jpg'' {px};{py};1280;720"
out s
RunConsole2 s
Posts: 64
Threads: 19
Joined: Nov 2012
Super to learn about both. I like to see it all so that I can expand. Your help is tremendous. This such a great program and such a great forum. Thanks