pspad:
--------------------------------------------------------------------------------
Ifvanything will modify your file from outside, stored undo is
useless.--------------------------------------------------------------------------------


The user starts the above-mentioned VBScript by shortcut and thus knows that the
file is modified externally. If the user does not like the result, he can use
the Undo's to return to the previous state. Then he presses Ctrl+S and his file
is back to the desired state.

Ok, here is my workaround: When the user starts the external program, the
current file is changed externally. Then I use VBScript to read the file as
"*sNewText*" and replace the old text in the active editor/tab with
"*obj.text(sNewText)*". This way all Undo's are preserved.

_Problem_: The encoding (charset) of the file. 

In order to display all characters as they should be, the encoding from the
read-in must match the encoding of the editor/tab. But this seems to be
impossible in VBScript.

So since it's not possible to reload the file without losing all Undo's, can you
please add a function for VBScript for my workaround to get the encoding for the
current editor/tab?

For example: 

obj.encoding(): string  
[color=#009900]returns editor encoding (only for saved file)[/color]

-- 
<https://forum.pspad.com/read.php?2,74331,74333>
PSPad freeware editor https://www.pspad.com

Odpovedet emailem