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


#1

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

#2

Oh, I finally did it this way:

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

#3

Morning @stramin,

That works but you should use the SDK.

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