Macro Question: Close Current File

I have a macro that opens a hardcoded file and copies the data into a variable for processing.

After that I need to close the file because I do not want to see the file I loaded into the buffer for any reason.

How do I close the buffer after I have done:
ko.open.URI(“c:/dev/func.lst”);
var buf = document.buffer;

Or maybe there is a better way to load a text file into a variable that I could not find.

Actually opening the file in Komodo (ie the UI) will be a bit overkill for what you’re wanting to do, I’d recommend having a look this - https://developer.mozilla.org/en-US/Add-ons/Code_snippets/File_I_O#Asynchronously

For closing the current edit file, you could use:

ko.views.manager.currentView.close();
// There is also this one - to avoid the save prompt when the file is dirty:
//ko.views.manager.currentView.closeUnconditionally();

though you may not even need to open it inside of Komodo - like Nathan says - as there are APIs to open and close files in memory (rather than having to open them in the Komodo editor).