FileReadLine does not read # character

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Tarrasque

FileReadLine does not read # character

17 Jan 2018, 06:59

Hello everybody.

I have a very simple script that just reads a string from a file and outputs whenever I press CTRL+ALT+p

^!p::
FileReadLine, Pwd, C:\pwd.txt, 1
Send %Pwd%
Return

It works great except when the files contains a # character. In this case it's ignored. Escaping the character does not help.

What could be the problem?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: FileReadLine does not read # character

17 Jan 2018, 07:26

You're wrong. FileReadLine takes that character without a problem (use a MsgBox to cross-check it).
Send <> SendRaw :!:
Tarrasque

Re: FileReadLine does not read # character

17 Jan 2018, 07:49

Thank you for your answer.

I'm not sure I understand.

I substituted Send %Pwd% with SendRaw %Pwd% and the result is the same.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: FileReadLine does not read # character

17 Jan 2018, 08:08

Code: Select all

F10::
   FileReadLine, Pwd, pwd.txt, 1 ; changed the path as C:\ is often restricted
   MsgBox % Pwd   ;  check the outcome of FileReadLine
   Send, %Pwd%   ; delivers "assword" ! which is slightly correct!
   Sleep, 800
   SendRaw, %Pwd%   ; delivers #password which 100% accurate
   Return

F12::Reload
F11::ExitApp
Tarrasque

Re: FileReadLine does not read # character

17 Jan 2018, 08:52

Thank you very much!!

Very nice answer.

I think I forgot to reload the script when I firs modified it. Now it works as a charm!!

Keep up the good work!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, iamMG and 170 guests