Author Topic: Question: How To Enumerate selected open files and copy the text to new buffer?  (Read 2732 times)

Brandon SE

  • Community Member
  • Posts: 6
  • Hero Points: 0
Does anybody know How To Enumerate selected open files and copy the text to new buffer?

Brandon SE

  • Community Member
  • Posts: 6
  • Hero Points: 0
Oh yeah...just in case here is my version information.

SlickEdit Version 12.0.3.0

Build Date: September 20, 2007
Emulation: SlickEdit (text mode edition)

OS: Windows XP
Version: 5.01.2600  Service Pack 3

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
i had some help with something similar from either hs2 or Graeme they deserve the hp+ : )

hope this helps in any way
copy all open buffers path + filename and paste into new buffer

Code: [Select]
_command void cfpc() name_info(',')
{
   int rc;
   push_clipboard_itype ('CHAR','',1,true); //LINE
   rc = for_each_buffer('_ss2');
   new_file();
   paste();
/*   if (rc !=0) {
      _message_box("RC from for_each_buffer = " rc, "FOR_EACH_BUFFER ERROR", MB_OK | MB_ICONEXCLAMATION)

   }*/
}

_command int _ss2() name_info(',')
{
   _str s='"' :+ p_buf_name :+'" '; /* file name and path  change needed here*/
   append_clipboard_text(s);
   return 0;
}



you need to change instead of filename then copy the contents of buffer

regards
ehab
« Last Edit: October 02, 2009, 01:48:58 pm by ehab »

Graeme

  • Senior Community Member
  • Posts: 2515
  • Hero Points: 327
I'm not sure exactly what you're trying to do but in case it's useful, you could look at the function
void ctl_close_button.lbutton_up()
 in tbfilelist.e.  It's used to close all the files that are selected in the files toolbar.  You could adapt it to do something else with the selected files.  If you need any help with that you could ask here again.

Actually it would probably useful for slick to have a standard function that called a supplied macro for each of the selected files in the files toolbar - maybe using for_list.

@ehab  - it was hs2...  :)

Graeme