Can't make my script work ONLY in a specific window

Discussion, questions and support.
Post Reply
Drakemoor
Posts: 7
Joined: Feb 20th, ’23, 20:23

Post by Drakemoor » Jun 5th, ’23, 23:51

I'm trying to make Fastkeys insert two Enter when I hit enter once and one Enter on Shift+Enter, only when typing in the Obsidian app. Unfortunately, it does it in all apps, regardless of the code I use. Here are two examples:

Code: Select all

#IfWinActive ahk_exe Obsidian.exe
::Enter::
Send {Enter 2}
return

::^Enter::
Send {Enter}
return
#IfWinActive
Here is a second one:

Code: Select all

::Enter::
Send, {ENTER}{ENTER}
return 

::^Enter::
Send, {ENTER}
return
I've tried putting the name of the app in the window option, but that also doesn't work.

Please help.
User avatar
Marko
Posts: 1756
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jun 6th, ’23, 07:07

You should use a name of the window or ahk_class to identify the window. Use Window Information Tool to get this info - Tools/Window Information.

Also, you are using the shortcut syntax incorrectly. It should be
Enter::
instead of
::Enter::
Drakemoor
Posts: 7
Joined: Feb 20th, ’23, 20:23

Post by Drakemoor » Jun 6th, ’23, 13:51

Thank you! That worked.
Post Reply