How to get the ko.views.manager.currentView filename?

Hi!

I am trying to get the current file name only (as string) in a javascript macro.

for example “myfile.c”

Where can I find documentation about the ko.views.manager.currentView elements?

var view = ko.views.manager.currentView;
var filename = view.document.name; // <- maybe something like this

Oh, I finally did it this way:

var view = ko.views.manager.currentView;
var filename = view.koDoc.file.baseName;

Morning @stramin,

That works but you should use the SDK.

require("ko/views").current().basename
  • Carey