First, you should read the brief overview chapter of power tip Unicode text and Unicode files in UltraEdit/UEStudio
. It is about a world wide agreement about how to interpret the 0's and 1's of a text file.
Another world wide agreement fulfilled by all browsers is that a .txt file is a plain text file and is therefore displayed as plain text independent on what this text file contains. You break this world wide agreement by putting into a .txt file HTML code and expect that the browsers interpret the text file with the HTML interpreting engine. But as you now know, they don't do that.
Now we come to another not explicitly expressed agreement: Show File in Browser
should be used for HTML files only by the user. Please read in your German UltraEdit help the page about Show File in Browser command
or read online the English help for this command
. Let us look together on last paragraph:
UE help wrote: This function uses the Shell Extensions and the default application associated with the extension will be used to show the file. If the extension is not associated with the browser the file will not be shown in the browser.
What does this mean in detail?
It means that Show File in Browser
is in real: open a temporary created file according to its file extension by the application associated with according to Windows registry
So if the active file is for example a CSV file with file extension .csv and for example Microsoft Excel is associated with .csv as opening application, using Show File in Browser
results in creating a temporary *.csv file by UltraEdit and opening it with MS Excel. Or if the active file is a *.vbs file, usage of Show File in Browser
results in getting the temporary file interpreted by the windows scripting host associated by default as opening application for .vbs files. And if the file is a Perl script with file extension .pl and this file extension is associated with installed Perl interpreter, the temporary file created by Show File in Browser
is interpreted by the Perl interpreter.
That are the agreements which you break all by putting HTML code into a .txt file and expecting that either the browsers interpret the .txt file like a .html file or that UltraEdit renames for you the file extension .txt to .htm to get the text file with HTML code displayed interpreted by your preferred browser.
As you can for unknown reason not rename the .txt file temporarily to .htm or .html, you have only two choices:
- You create a user tool which calls a batch file with full name of active file as parameter. The batch file evaluates the file extension. If file extension is .txt, a copy of the file in same directory is made with file extension .htm. Then the default browser is started with either original file name or with file name of created copy with right file extension for the browser. This would be easy to code. A little bit more difficult to code in batch file would be the deletion of temporary file created by the batch file for the .txt file. A simple solution would be waiting 5 to 10 seconds and then delete the created copy with file extension .htm as after 5 to 10 seconds the browser should have been started and interpreted the file already.
- You use the Toggle Browser View feature of UltraEdit as explained in power tip HTML preview to get the HTML code in .txt file displayed within UltraEdit interpreted by Internet Explorer passed by UltraEdit via a special interface offered by Microsoft directly to the HTML interpreting engine of IE (direct DLL function call). The disadvantage of this method is that images referenced with a relative path to file containing HTML code are not displayed nor are loaded other files like *.js or *.css referenced with a relative path as the HTML interpreting engine interprets directly the HTML code passed by UE to the engine via the interface and therefore the engine does not know path and name of file containing the interpreted HTML code.
Solution 2 is what you have tried already, but does not help on your task to copy to clipboard the displayed text after interpreting the HTML code in the text file. UltraEdit supports selecting the displayed text, but not copying the selected text for unknown reasons.