
without actually adding it to the DOM.ĭownloadLink.href = (textFileAsBlob) Var downloadLink = document.createElement("a") ĭownloadLink.download = fileNameToSaveAs ĭownloadLink.innerHTML = "Download File" Var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value Var textToWrite = document.getElementById("inputTextToSave").value
Rich text editor for mac how to#
The code below is shamelessly stolen from the, and will give you some direction on how to implement this. Ideally it would not change any global environment settings, but I can give that second requirement up, if I have no choice.Ī way to do some simple text editing independent of the system is using a combination of HTML and Javascript.

I don't want to require the user to do manual configuring, I want the script to initialize itself.

Now I want that script to invoke an editor on an ASCII file that I need stay as an ASCII file. I have a python script that runs 'out-of-the-box' on any mac. Alternatively, is there a third party editor whose license allows that I can include with my script to serve this need? My best hope is that there is some programatic way to configure TextEdit to behave as an ASCII editor. Sadly Nano and friends do not allow cursor positioning, and Apple lost its mind with TextEdit upgrades and really destroyed that editor! allows the user to click the mouse to position the cursor.will work "out of the box" on any standard mac system.

