Author Topic: Getting the buffer or document name from the file tab  (Read 2830 times)

Andy

  • Community Member
  • Posts: 5
  • Hero Points: 0
Getting the buffer or document name from the file tab
« on: January 04, 2012, 05:42:11 pm »
I want to run the following code from the File Tab shortcut menu:
Code: [Select]
    shell('explorer "' strip_filename(p_buf_name, 'N') '"', "A");
but p_buf_name is "not allowed on this object". What do I have to do? Set the focus back into the buffer first?? That seems weird.

Thanks

hs2

  • Senior Community Member
  • Posts: 2752
  • Hero Points: 291
Re: Getting the buffer or document name from the file tab
« Reply #1 on: January 04, 2012, 07:24:04 pm »
I'd propose to rip and adopt an existing 'File Tab' context menu command from <SE inst dir>\macros\bufftabs.e (e.g. buff_menu_clipboard)
Setting the focus back to the edit window doesn't really help b/c it's p_buf_name property probably differs.
Note that all the p_<something> things are properties of a window object which must either be active to get access to it's props or you've to specify it's window id like this 'wid.p_<something>'.
HS2


Andy

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: Getting the buffer or document name from the file tab
« Reply #2 on: January 06, 2012, 01:57:34 am »
That was great! Thanks!