Topic: Copy filename/directory to clipboard (1 of 2), Read 27 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, May 12, 2006 11:38 PM

I just added these two macros to keymac.lib.
You might find them useful.

// FN2CLIP.VDM - Place current file's filename into the clipboard
//
Reg_Set(103,FILENAME) //@103 = Current Filename
#103 = Buf_Num //Save current buffer ID
Buf_Switch(Buf_Free(EXTRA)) //Switch to a free buffer
Reg_Ins(103) //Insert the filename
Clip_Copy_Block(0,Cur_Pos) //Copy it to the clipboard
Buf_Quit(OK) //Close the buffer
Buf_Switch(#103) //Switch back to original buffer
Return


// PATH2CLIP.VDM - Place current file's path (directory) into the clipboard
//
Reg_Set(103,PATHONLY) //@103 = Current path-directory
#103 = Buf_Num //Save current buffer ID
Buf_Switch(Buf_Free(EXTRA)) //Switch to a free buffer
Reg_Ins(103) //Insert the filename
if (File_Size==2 && (Cur_Char(-1)==':')) { //If in a root drive
Ins_Text("\") //.. add a backslash
}
Clip_Copy_Block(0,Cur_Pos) //Copy it to the clipboard
Buf_Quit(OK) //Close the buffer
Buf_Switch(#103) //Switch back to original buffer
Return

Ted.


Ted.
-------------------------------------------------------------------------
Ted Green (ted@...) Greenview Data, Inc.
Web: www.... Fax: 734-996-1308 PO Box 1586, Ann Arbor, MI 48106
Tel: (734) 996-1300 Desk: 734-369-3550 VEDIT - Text/Data/Binary Editor
-------------------------------------------------------------------------
www.SpamStopsHere.com ranked #1 in accuracy by Network Computing Magazine

 


Topic: Copy filename/directory to clipboard (2 of 2), Read 16 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Saturday, October 07, 2006 04:45 PM

On 5/12/2006 11:38:45 PM, Ted Green wrote:
>I just added these two macros
>to keymac.lib.
>You might find them useful.

Thanks Ted,

Indeed, I find these two macros useful.


-peter