1

I created a button in the toolbar using

GPS.Toolbar().append(button)

In the On_Click function of the button I want it to print the current file's name.

I wrote print GPS.Current_Context().file() But it does'nt work and give me the error : Current_Context has no attribute file

Anyone knows why?

123456
  • 113
  • 8

1 Answers1

1

Use EditorBuffer to get the current view's name:

EditorBuffer.get().current_view().title()

This will give you the title of the current editor tab, which is the name of the edited file.

Or B
  • 1,675
  • 5
  • 20
  • 41