script to open Screen Sketch on Win10

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bakr
Posts: 9
Joined: 04 Jan 2018, 09:50

script to open Screen Sketch on Win10

23 Feb 2018, 13:54

Does anyone know an AutoHotKey script that opens Screen sketch directly? i know that the shortcut Win+W opens Windows Ink Workspace but i have to select screen sketch afterward (which is annoying). Any help appreciated.
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: script to open Screen Sketch on Win10

23 Feb 2018, 14:31

Have it click on the location to select Screen Sketch after the menu pops up. Just change the coordinates in the script below so it clicks on the right place on your monitor.

Code: Select all

CoordMode, Mouse, Screen
Send, #w
Sleep, 500
Click, 2400, 1040
gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: script to open Screen Sketch on Win10

23 Feb 2018, 20:16

Code: Select all

run ms-penworkspace://Capture	; Screen Sketch
run ms-penworkspace://Create		; Sketch Pad
titep
Posts: 31
Joined: 14 Nov 2015, 09:01

Re: script to open Screen Sketch on Win10

22 May 2020, 04:48

How could we run it in maximized windows ?

Code: Select all

Run, ms-penworkspace://Capture,, Max, Hwnd
doesn't work; Hwnd gives me a blank value :shock:
vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: script to open Screen Sketch on Win10

22 May 2020, 05:06

Code: Select all

Run, ms-penworkspace://Capture
WinwaitActive,Snip & Sketch
WinMaximize,A
gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: script to open Screen Sketch on Win10

22 May 2020, 05:09

titep wrote:
22 May 2020, 04:48
Hwnd gives me a blank value :shock:
Probably as could be expected:
https://www.autohotkey.com/docs/commands/Run.htm#Parameters wrote:OutputVarPID
[...] The variable will be made blank if the PID could not be determined, which usually happens if a system verb, document, or shortcut is launched rather than a direct executable file.
On Win10, many built-in tools now run under the ApplicationFrameHost which seems to complicate things.
This here seems to work, if you just have one instance open at a time...

Code: Select all

w::		; press w
run ms-penworkspace://Capture
WinWaitActive Ausschneiden ahk_exe ApplicationFrameHost.exe
WinMaximize Ausschneiden ahk_exe ApplicationFrameHost.exe
return
(Replace Ausschneiden with the start of the wintitle on your system; you can try Window Spy to check it.)
I haven't really done much with the ApplicationFrameHost - perhaps someone has a better, or more reliable, idea.

edit: Oh, too late.
titep
Posts: 31
Joined: 14 Nov 2015, 09:01

Re: script to open Screen Sketch on Win10

24 May 2020, 11:35

@gregster @vsub

Thanks. You two's simple method works like a charm. :) :thumbup:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: drani, montie and 231 guests