Basic auto run notepad + type

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nd1126
Posts: 1
Joined: 10 Sep 2018, 20:51

Basic auto run notepad + type

10 Sep 2018, 21:01

Hey I've been working on the ahk for about 4 days now and I seriously need some help.
It really seems like there's nothing wrong with my script but every time I try and use it.. it doesn't work.
Mine looks the same as the other scripts... in my point of view :/
I need you guys to take a look and see what's wrong .

Code: Select all

WORKING SCRIPT(got it from the internet)
#t::
Run, Notepad
Send, Hello`n 
Send, I'm a student. `n 
Return
[code]

[code]
MY SCRIPT (which doesn't work properly)
LAlt & n::
Run, Notepad
Send, nd1126 `n 
Send,this is my id`n
return
Attachments
캡처.PNG
(5.53 KiB) Downloaded 80 times
Last edited by nd1126 on 10 Sep 2018, 23:58, edited 1 time in total.
User avatar
tomoe_uehara
Posts: 213
Joined: 05 Oct 2013, 12:37
Contact:

Re: Basics

10 Sep 2018, 21:09

Code: Select all

<!n::
msgbox ok
return
WingbtZ
Posts: 22
Joined: 09 Aug 2018, 04:41

Re: Basics

11 Sep 2018, 06:47

tomoe_uehara wrote:

Code: Select all

<!n::
msgbox ok
return
As already said.
Take a look at this to learn more.
https://autohotkey.com/docs/KeyList.htm

Code: Select all

!n::
; Your code
return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Basic auto run notepad + type

11 Sep 2018, 07:24

- Your original script worked for me. Perhaps you could explain further what doesn't work.
- I've added some code to make sure that it writes to the new window. Cheers.

Code: Select all

LAlt & n::
Run, notepad,,, vPID
WinWait, % "ahk_class Notepad ahk_pid " vPID
hWnd := WinExist()
WinActivate, % "ahk_id " hWnd
Send, nd1126 `n
Send, this is my id`n
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Google [Bot], hiahkforum, ShatterCoder and 97 guests