with latest version of AHK (not meaning previous ones didn't have the issue) at the moment of the tests, and intervening on notepad2-mod (on its Scintilla1 control) in order to modify selected string using :

Thank you for reading my post and for any help you my provide.Also, thank you for this great automation/scripting tool.I'd just love to see it on more platforms (let me dream of such a day).

patienly waiting,Clu2017083140543

BTW : an anticipated refutal of my use of selections ... I'm ABSOLUTELY avoiding the use of the clipboard for many reasons (security, speed, side effects...). so, no need to try to convince me to rely on it (i do for many other things, just no here) and, anyway... not the issue here. thank you for your understanding.

Format : ouch ... did my editing offline, lost indentations and more. Life is a *$£ù% some times!

ControlGet wrote:Selected: Sets OutputVar to be the selected text in an Edit control. If no text is selected, OutputVar will be made blank and ErrorLevel will be set to 0 (i.e. no error). Certain types of controls, such as RichEdit20A, might not produce the correct text in some cases (e.g. Metapad).

... and apparently the Scintilla control belongs to this 'certain control types'.

ControlGet, ..., Selected is designed to be used with common Edit controls which don't provide a way to get the selection directly. AHK is sending EM_GETSEL and WM_GETTEXT messages to the control and has to use what it gets. So it's defenitely not an AHK bug. The Scintilla control provides an own message SCI_GETSELTEXT to retrieve the current selection which might work reliable. I never used it and any qestions about how to use it (especially for another application) would be a topic for "Ask For Help".