PasteIntoFile icon indicating copy to clipboard operation
PasteIntoFile copied to clipboard

How to change default the file's extension that will be saved?

Open liwenjing93 opened this issue 6 years ago • 7 comments

Hi @EslaMx7, I regularly save images from clipboard, and I like to save them with .Jpg instead of .Png format, because .jpg will have a smaller file size than .png. However, everytime I want to save an image, I have to choose AGAIN .jpg because the default option is always .png. It has always annoyed me a lot.

image

I hope you could make some changes into that software in the next release, so that I could change the default option from png to jpg or another extension.

Thank you so much, your software is really useful. I love it so much.

Best Regards,

liwenjing93 avatar Feb 10 '20 17:02 liwenjing93

@liwenjing93 Thank you very much for your feedback! I will make sure to have this issue fixed in the next release very soon.

EslaMx7 avatar Feb 12 '20 08:02 EslaMx7

I will make sure to have this issue fixed in the next release very soon. Thank you!!!

liwenjing93 avatar Feb 12 '20 12:02 liwenjing93

Choosing a default would be great!

Additionally, would also be great if an underscore is used in the automatically generated file name, between the date and the time, so as to avoid hyperlink issues: 13-04-2020_21-38-23

edwardjohnson11 avatar Apr 14 '20 01:04 edwardjohnson11

BUMP +1 on being able to set the default file extension. For the majority of saving applications I choose jpg as it takes up less space.

subz390 avatar Sep 12 '21 15:09 subz390

Yes, it would be so good to change or have option for default image format. I think most people use jpg for any kind of image, except for some specific purpose.

barn852 avatar Jan 21 '22 18:01 barn852

For anyone who's interested here's an AutoHotkey script that'll send keyboard inputs to select the jpg save as extension and press enter.

  1. Install AutoHotkey
  2. Copy the script into a file with an .ahk extension and double click the file to run it.
  3. To start up with Windows put the file in the Windows startup folder.

For reference I've added the modifier keys in comments so you can set your key combination preference.

#SingleInstance, Force
SendMode Input ; Forces Send and SendRaw to use SendInput buffering for speed.
SetWorkingDir, %A_ScriptDir%
#MaxThreadsPerHotkey, 1 ; no re-entrant hotkey handling

; ! Alt
; + Shift
; ^ Ctrl
; ^+ Ctrl Shift

; ====================================================
; PasteIntoFile
; sets the save as extension to jpg
; Ctrl Shift j
#IfWinActive ahk_exe PasteIntoFile.exe
^+j::
    Send, {Tab}{Down}{Tab}{Tab}{Tab}{Tab}{Enter}
return

ahkinstructions

subz390 avatar Jan 22 '22 11:01 subz390

Thanks @subz390 for the idea of using AutoHotkey. I have modified it so the script changes png to jpg any time PasteIntoFile is executed. Maybe it is not the nicest solution, but it works. If you want to use it for other extension, just replace png/jpg accordingly.

#SingleInstance, Force
While 1{
  WinWaitActive ahk_exe PasteIntoFile.exe
  ControlGetText Val,Edit1,ahk_exe PasteIntoFile.exe
  If (Val="png")
    ControlSend Edit1,{Down},ahk_exe PasteIntoFile.exe
}

update1: changed the code, the previous did not work well update2: I have just found eltos' fork that has a config to set the default image format. No need for the the ahk script.

barn852 avatar Apr 02 '22 18:04 barn852