Wednesday 25 October 2017

windows vista - How can I automatically save screen shots by the press on the Prt Scr button?


I want a screen shot to be saved automatically to a location I specify, as soon as I press the Prt Scr button on my keyboard, or the Alt+Prt Scr combo. I also want the date and time to be used as file name for each new screen shot. And I want the files to be saved as PNG images.


Is there a Windows program that would allow me to do just this? I don't want any other fancy features like editing and making notes, etc. just a plain simple program that will either automatically save the screen shots to a pre-set location or prompt me where I want to save it. I don't want to go through MS Paint to save the shots.


I guess what I'm after is a little bit of Linux behavior of Print Screen, but only for Windows. And I additionally want the files to be named by the date and time they were taken.


Update:


Meanwhile, I have found one called Greenshot. But I don't know how to get the file name pattern right.


This is the default pattern.


${capturetime:d"yyyy-MM-dd HH_mm_ss"}-${title}

Can someone explain this? Why do they have the title capturetime and the quotation marks? It produces file names like this.


2013-01-26 15_24_28-Greenshot.png

And this is what it says about the file patterns in the program description.


${YYYY} year, 4 digits
${MM} month, 2 digits
${DD} day, 2 digits
${hh} hour, 2 digits
${mm} minute, 2 digits
${ss} second, 2 digits
${NUM} incremental number, 6 digits
${title} Window title
${user} Windows user
${domain} Windows domain
${hostname} PC name

How do I get files that include year, month and day, separated by a dash, followed by hour, minute and second? I want to include a time for uniqueness of the file name.



Answer



Greenshot is a great program!


For the output filename pattern, if you use a pattern of ${YYYY}-${MM}-${DD} ${hh}-${mm}-${ss} then you'll get files with names such as 2013-01-26 10-34-49.png.


I couldn't find any documentation on the capturetime keyword, but it is an advanced function. A pattern of ${capturetime:d"yyyy-MM-dd HH-mm-ss"} produces the same output as above. For the technically inclined, when I look at the source code, this is what I've determined:



  • The letter after the colon needs to be a d which indicates date/time format.

  • After the d, the quoted text is a format string passed into C#'s DateTime.ToString() method. You can find quite a few examples here.


If you need more advanced date formatting such as written out month names, timezones, etc., then you might find benefit of using the above capturetime pattern.


P.S. some older versions of Greenshot used patterns such as %YYYY% instead of ${YYYY}. Be sure to check the file pattern help window so you use the correct format.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...