Window Screen to Paint.net

Share your favorite FastKeys commands
Post Reply
Jim Jaffe
Posts: 12
Joined: May 25th, ’20, 13:55

Post by Jim Jaffe » Jan 3rd, ’24, 13:33

Need help in fixing my command "Window Screen to Paint.net". It is based on the standart command "Window Screen to Paint" with little modification:

Code: Select all

clipsave=%clipboard%
Send, !{PRINTSCREEN}
ClipWait 1
Run, C:\Program Files\paint.net\PaintDotNet.exe
WinWaitActive ahk_exe paintdotnet.exe
Send, ^!v ;Ctrl Alt V
ClipWait 1
clipboard=%clipsave%
When using "Window Screen to Paint.net" command I constantly get "Clipboard doesn't contain an image" message on opening Paint.net for the first time. But when Paint.net is already opened, the command works fine.
User avatar
Tom
Posts: 849
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jan 5th, ’24, 17:50

Not sure, seems to be a paint.net behaviour
https://www.google.com/search?q=Clipboa ... 79&dpr=1.5
Jim Jaffe
Posts: 12
Joined: May 25th, ’20, 13:55

Post by Jim Jaffe » Jan 6th, ’24, 08:28

I'm sure it's the problem of clipboard handling by the code, because code without clipsave function works as intended:

Code: Select all

Send, !{PRINTSCREEN}
ClipWait 1
Run, C:\Program Files\paint.net\PaintDotNet.exe
WinWaitActive ahk_exe paintdotnet.exe
Send, ^!v ;Ctrl Alt V
User avatar
Tom
Posts: 849
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jan 6th, ’24, 14:48

Would this help?

Code: Select all

clipsave=%clipboardall%
Jim Jaffe
Posts: 12
Joined: May 25th, ’20, 13:55

Post by Jim Jaffe » Jan 6th, ’24, 19:27

Saving clipboard with clipboardall has no effect.
This is especially odd, because MS Paint works well with default command.
User avatar
Tom
Posts: 849
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jan 6th, ’24, 22:13

Hm, then you can use your script you posted and works. The only difference is that it doesn’t switch back to the original clipboard value after pasting.
Post Reply