Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Capture mouse and add to command
#1
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.
Code:
Select All      Help
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
#2
something like this should work for ya


Code:
Select All      Help
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
#3
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
Code:
Select All      Help
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
#4
I use a timestamp like this. How could I also replace the test2.jpg to 1902081409.jpg (that being the current timestamp). Thanks
Code:
Select All      Help
DateTime t.FromComputerTime
str sf=t.ToStrFormat("{yyMMdd}{HHmm}")
key (sf)

Is this the bestway?
Code:
Select All      Help
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
#5
much simpler way replacerx is not needed


Code:
Select All      Help
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
#6
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


Forum Jump:


Users browsing this thread: 1 Guest(s)