I have latest versions on 2 laptops
I have some simple text replacements.
On one, I get carriage returns
On the other - it just doesnt work.
It's really frustrating.
I do have some workarounds - like copying the text and pasting.
But that's long winded - I have hundreds of text replacement short cuts I use.
Any suggestions why I have this problem?
Thanks
AHK different on 2 identical PC's
Re: AHK different on 2 identical PC's
Make sure you run the same versions of AutoHotkey on both systems, and ensure both systems are running the same script, especially check the encoding, Unicode or not but also which line endings your scripts have (either DOS, Unix or Mac even), having `r`n or just `n in there might make a difference. (I'm referring to DOS v UNIX etc not actually sending `r`n or `n here)
And of course post an example, perhaps you're making basis mistake(s)
And of course post an example, perhaps you're making basis mistake(s)
Re: AHK different on 2 identical PC's
With no sample code or sample data, it's hard to tell.
Re: AHK different on 2 identical PC's
the code is super simple:
It comes out: See attachedXYZ
This happens only on one machine. all others are OK.
this machine is a fast 2.8GHz machine running Windows 10.
I have the IDENTICAL machine - there the same problem doesn't happen
I have 2 other machines - slower - all OK there
REALLY frustrating
Code: Select all
::]ksub::
SendInput,
(
See attached
XYZ
)
Return
This happens only on one machine. all others are OK.
this machine is a fast 2.8GHz machine running Windows 10.
I have the IDENTICAL machine - there the same problem doesn't happen
I have 2 other machines - slower - all OK there
REALLY frustrating
Re: AHK different on 2 identical PC's
If your issue is that there are no new line characters between "See attached" and "XYZ", then try:
Code: Select all
::]ksub::
SendInput,
(
See attached{U+000D}{U+000D}{U+000D}XYZ
)
Return
Re: AHK different on 2 identical PC's
thanks for the reply.
why would the above work?
my main problem is why the code just doesn't work the same on all pc's?
i really really need to be the same on all pc's.
it's crazy
i have other laptops that are slower - that work perfectly ok
there must be an answer?
why would the above work?
my main problem is why the code just doesn't work the same on all pc's?
i really really need to be the same on all pc's.
it's crazy
i have other laptops that are slower - that work perfectly ok
there must be an answer?
Re: AHK different on 2 identical PC's
Maybe, just maybe, in one of the pc's you have some program or script running that interfere/block ahk...
Re: AHK different on 2 identical PC's
@nismo
no, it works. just behaves really differently.
it's winding me up
i can't be the ONLY one suffering
no, it works. just behaves really differently.
it's winding me up
i can't be the ONLY one suffering
Re: AHK different on 2 identical PC's
And you are 100% sure the AHK scripts are byte for byte identical?
ie I could make you two files that LOOKED identical in Notepad++, but were not.
eg, one could have DOS style CRLF linefeeds, and one could have UNIX style linefeeds.
ie I could make you two files that LOOKED identical in Notepad++, but were not.
eg, one could have DOS style CRLF linefeeds, and one could have UNIX style linefeeds.
Re: AHK different on 2 identical PC's
@evilC i have 4 PC - all with dropbox. all share the same.
with the laptop in question, in the early days, i posted questions on the AHK forums asking why why why why i couldn't get carriage returns in my autotext output on a keyboard shortcut. i would post a simple script and many others would reply: hey nothing wrong with script - works fine for me?
i was using AHK on this other laptop.
super weird.
it's a super fast laptop 2.8 Intel Ghz with 8GB RAM. it's 64 bit windows 10 (i had the problems since windows 8).
there HAS to be an answer!
with the laptop in question, in the early days, i posted questions on the AHK forums asking why why why why i couldn't get carriage returns in my autotext output on a keyboard shortcut. i would post a simple script and many others would reply: hey nothing wrong with script - works fine for me?
i was using AHK on this other laptop.
super weird.
it's a super fast laptop 2.8 Intel Ghz with 8GB RAM. it's 64 bit windows 10 (i had the problems since windows 8).
there HAS to be an answer!
Re: AHK different on 2 identical PC's
Try things like this to inspect the text:
Check the key history. 'View, Key history and script info'.
Which commands have the problem, is it just SendInput?
If the issue is with the enter key try:
Check that there isn't an Enter hotkey assigned:
What programs are you sending enter to? For example if it's a one-line Edit box, enters don't work. Are you trying the same scripts on the same programs (on different PCs).
Are you using the same script editors. Do the files have the same encodings. Are you using the same versions of AutoHotkey. Admin issues relating to scripts, individual programs and the PCs generally.
Code: Select all
vText := StrReplace(vText, "`r", "[CR]")
vText := StrReplace(vText, "`n", "[LF]")
MsgBox, % vText
Which commands have the problem, is it just SendInput?
If the issue is with the enter key try:
Code: Select all
SendInput a`n`n`nb
Code: Select all
Enter::
MsgBox, % A_ThisHotkey
return
Are you using the same script editors. Do the files have the same encodings. Are you using the same versions of AutoHotkey. Admin issues relating to scripts, individual programs and the PCs generally.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: AHK different on 2 identical PC's
are you testing in the same program, and does that program have the same settings on all pc's?
like, if it's in notepad++, make sure you have told all your np++'s to accept simply "\n" and not just "\r\n".
try it in plain old boring Notepad that comes with the OS on all Windows pc's. if it works on all of those notepad.exe's, it's your other programs fault.
like, if it's in notepad++, make sure you have told all your np++'s to accept simply "\n" and not just "\r\n".
try it in plain old boring Notepad that comes with the OS on all Windows pc's. if it works on all of those notepad.exe's, it's your other programs fault.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
*poke*
Is it December 21, 2012 yet?
Re: AHK different on 2 identical PC's
guys, thanks for the replies
i use notepad++ on all pc's
there could well be a different setting in notepad++
but whatever the setting, surely the code should run the same
i'm using the code in a browser
like an email reply in gmail - or just tabbing through a form
i use only chrome + firefox
i will try some of the above mentioned and will reply later - just to cross those out
i use notepad++ on all pc's
there could well be a different setting in notepad++
but whatever the setting, surely the code should run the same
i'm using the code in a browser
like an email reply in gmail - or just tabbing through a form
i use only chrome + firefox
i will try some of the above mentioned and will reply later - just to cross those out
Re: AHK different on 2 identical PC's
"but whatever the setting, surely the code should run the same"
Maybe, maybe not. I am not sure on this, but I would not be surprised if, when you open a file with DOS line-endings in a copy of Notepad++ that has been set to use UNIX line-endings, that it converts the file.
This is what we are all telling you - you need to examine the contents of the string *as the code runs* to see if the code is executing with identical string content on both machines.
Your fundamental problem is a difference in how the code handles line endings.
Seeing as you are using a continuation section, the line-endings of the file *are part of the code*.
Maybe, maybe not. I am not sure on this, but I would not be surprised if, when you open a file with DOS line-endings in a copy of Notepad++ that has been set to use UNIX line-endings, that it converts the file.
This is what we are all telling you - you need to examine the contents of the string *as the code runs* to see if the code is executing with identical string content on both machines.
Your fundamental problem is a difference in how the code handles line endings.
Seeing as you are using a continuation section, the line-endings of the file *are part of the code*.
Re: AHK different on 2 identical PC's
Interesting ideajeeswg wrote: Check that there isn't an Enter hotkey assigned:Code: Select all
Enter:: MsgBox, % A_ThisHotkey return
SendInput,`n is translated to pressing and releasing the enter key. You don't send text, you send keypresses, although simulated. So if notepad++ accepts the enter key, it will make the appropriate line break. With your script, I loose one line break if I use the hotstring in the same notepad++ where the code is, because notepad++ auto completes attached with enter, eating one of the line breaks, so if your real script uses only one line break, i.e.,
Code: Select all
SendInput,
(
See attached
XYZ
)
Good luck.
Re: AHK different on 2 identical PC's
@Helgef.
Haha re. 'Interesting idea'. Whenever I have a hotkey issue, it might be that a hotkey already exists, and creating a new hotkey can confirm this by causing a 'Duplicate hotkey.' error.
Haha re. 'Interesting idea'. Whenever I have a hotkey issue, it might be that a hotkey already exists, and creating a new hotkey can confirm this by causing a 'Duplicate hotkey.' error.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: AHK different on 2 identical PC's
Hehe, ok, I guess it makes sense if you have really big scripts then. However, Enter:: needs the keyboard hook (I think), so the sendinput wouldn't trigger it without raising the sendlevel.
Cheers.
Cheers.
Re: AHK different on 2 identical PC's
guys thanks for all the replies
mixed results
i made this in plain boring notepad (not notepadd++)
i get output: See attachedXYZ
i know i wont get the same output on my other pcs
i tried running the code on notepad (another instance). i know from past experience that the SAME will happen in the browser.
i have code that tabs through form fields and copies them.
when run on problem pc, it runs different
the number of tabs are different - i tab to traverse fields
this works!!
NOW... the thing is... with the first example above... it DOES give me the newline chars!
except it put them right at the end - AND not in the place where i actually wanted
i tested all other suggest code:
i added a few items above - these arent the issue. my problem occurs with the most simple version of AHK code
thanks for all the help
mixed results
Code: Select all
::]ksub:
SendInput,
(
See attached
XYZ
)
Return
i get output: See attachedXYZ
i know i wont get the same output on my other pcs
i tried running the code on notepad (another instance). i know from past experience that the SAME will happen in the browser.
i have code that tabs through form fields and copies them.
when run on problem pc, it runs different
the number of tabs are different - i tab to traverse fields
Code: Select all
::]ksub:
SendInput,
(
See attached{U+000D}{U+000D}{U+000D}XYZ
)
Return
NOW... the thing is... with the first example above... it DOES give me the newline chars!
except it put them right at the end - AND not in the place where i actually wanted
i tested all other suggest code:
Code: Select all
#SingleInstance force
::]mytest::
SendInput,
(
See attached
XYZ
)
Return
::]mytest2::
SendInput,
(
See attached{U+000D}{U+000D}{U+000D}XYZ
)
Return
::]keytest::
vText := StrReplace(vText, "`r", "[CR]")
vText := StrReplace(vText, "`n", "[LF]")
MsgBox, % vText
Return
::]keytest2::
SendInput a`n`n`nb
Return
::]keytest3::
MsgBox, % A_ThisHotkey
return
MsgBox, ,, AutoHotKey now loaded and ready to be used, 0.5
#F10::Reload ;<- Windows Key + F10 causes the script to reload itself
thanks for all the help
Re: AHK different on 2 identical PC's
Btw I intended my replace text code to be used like this:
Best of luck, interesting about the enters being queued.
Btw you can write the script in Notepad, but you can also test executing the script when Notepad is the active window also, to check that the scripts are sending the same thing.
Code: Select all
q:: ;reveal CRs and LFs
vText = ;continuation section
(
See attached
XYZ
)
SendInput {Raw}%vText%
;vText := StrReplace(vText, "`r", "[CR]")
;vText := StrReplace(vText, "`n", "[LF]")
vText := StrReplace(vText, "`r", "[Chr(13)]") ;[Chr(13)] is more noticeable than [CR]
vText := StrReplace(vText, "`n", "[Chr(10)]")
MsgBox, % vText
return
Btw you can write the script in Notepad, but you can also test executing the script when Notepad is the active window also, to check that the scripts are sending the same thing.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: AHK different on 2 identical PC's
@omar, did you do this? See, KeyHistory.jeeswg wrote:Check the key history. 'View, Key history and script info'.
Who is online
Users browsing this forum: KruschenZ and 61 guests