Topic: ClipCatch receives all text from ClipBoard (1 of 19), Read 74 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 16, 2004 08:30 AM


ClipCatch.vdm receives all text from ClipBoard in an endless loop and inserts the text into the current buffer.

You can configure it to begin every insertion on a new line or insert the data as it is.

To stop it, simply press Ctrl-C.


Due to limitations of the used Clip_Copy_Block() only text with 2 or more character will work.

(Ted: It would be nice if Clip_Copy_Block(0,0) or so would empty the Clipboard. Up to now that's not possible).

Christian

Note:
The attachment was now outdated, so I removed it.
That old version is available here for reference:
http://ziemski.privat.t-online.de/vedit/macros/clipcatch-0.vdm

For newer version see following thread.

 


Topic: Re: ClipCatch receives all text from ClipBoard (2 of 19), Read 59 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Thursday, January 29, 2004 05:02 PM



vedit-macros Listmanager am 28 Jan 2004, 4:46:
> ClipCatch.vdm receives all text from ClipBoard in an endless loop and
> inserts the text into the current buffer.

Christian: this is a very useful tool! I will use it to copy data
screenwise from linguistic corpora that don't have an export
function.

Thanks and regards

Fritz


--
Dr. Friedrich Heberlein, Akad. Direktor
Seminar für Klassische Philologie, KU Eichstaett-Ingolstadt
Universitaetsallee 1
D-85071 Eichstaett / Bayern

 


Topic: ClipCatch receives all text from ClipBoard (3 of 19), Read 47 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Wednesday, April 07, 2004 05:57 PM

On 1/29/2004 7:38:03 AM, Christian Ziemski wrote:
>
>And here an optimized version
>of ClipCatch.vdm.

Christian,

First and foremost thanks for your ClipCatch.vdm macro.

I have used it to copy several examples from the Macro Language Manual to a .txt file. The emphasis being on "several", since for a single example I could do it before, with the Ctrl-C and Ctrl-V keys. Then, I converted the parentheses and launched the examples. It worked fine on my laptop.

Now this conversion is a simple issue, essentially, it calls the txt-word.vdm. So, I would like to ask you, to possibly include such an optional call into your macro. Then, each Vedit user could call his/her favorite macro after your ClipCatch macro.

Thanks for all your help.


-peter.

 


Topic: Re: ClipCatch receives all text from ClipBoard (4 of 19), Read 48 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 09, 2004 01:15 PM

On Wed, 07 Apr 2004 17:57:00 -0400, Peter Rejto wrote:

>[ClipCatch.vdm macro]
>
>I have used it to copy several examples from the Macro Language Manual to a
>.txt file. [...]
>Then I converted the parentheses and launched the examples.
>
>Now this conversion is a simple issue, essentially, it calls the txt-word.vdm.
>So, I would like to ask you, to possibly include such an optional call into
>your macro. Then, each Vedit user could call his/her favorite macro after your
>ClipCatch macro.

First I thought that would be too specific.
But then I realized it a good idea.

So I wrote a new CLIPCATCH2.VDM macro.

It's attached and needs some beta-testing!
After some more beautifying I'll publish it via my homepage too.


From the options:

#91 = 1 // 1 = let every paste begin at Begin_Of_Line
// 0 = insert exactly like copied into the ClipBoard.

#92 = 0 // 0 = no further formatting
// 1 = call the macro CLIPCATCX2.VDM after every paste
// 2 = call the subroutine USRFORMAT below after every paste
// 3 = insert quote-characters "> " in front of every
// pasted line (forces newlines like #91=1)
// 4 = remove empty lines from every pasted block,
// but put an empty line after a block
// (forces newlines like #91=1)


So you can write your own code within the subroutine USRFORMAT in the
macro or create a new macro called CLIPCATCX2.VDM in \vedit\user_mac
which is used for that. Please have a look at my macro's comments.


>Thanks for all your help.

You are welcome.


Christian

Note: Outdated attachment removed. See following message for update.

 


Topic: Re: ClipCatch receives all text from ClipBoard (5 of 19), Read 52 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 16, 2004 08:32 AM


Here is the promised update:

I modified the macro internally and added some features.
Now it pops up a dialog at startup where the user can change
the behaviour easily.

It follows a quote of the dialog, which shows the features:


This macro watches the ClipBoard and retrieves all
text from there, pasting it into the current buffer.

The paste is done
() simply at cursor position
() beginning at a new line
() preceeded with an empty line
() preceeded with a time stamp
with
() no further formatting
() calling subroutine USRFORMAT
() calling external macro named below
() quoting all lines with character(s) below
() removing empty lines and building a paragraph
() compressing whitespace to single space

?? quoting character(s):
?? external macro:


You can download it from:
http://ziemski.privat.t-online.de/vedit/macros/clipcatch.vdm

Please give it a try and report problems or suggestions here.

Christian

Note:
I changed the name of the macro from clipcatch2 to clipcatch at 04/16/2004

 


Topic: Re: ClipCatch receives all text from ClipBoard (6 of 19), Read 46 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Friday, April 09, 2004 06:35 PM

Thanks Christian,

I have just downloaded CLIPCATCH2.VDM. I really appreciate your adding the USRFORMAT subroutine.

Incidentally, Reg_Set(52, CLIPCATX2) or something like that did catch my eyes. I can not copy and paste for an exact quotation. My question is the X versus H.

I shall report back to you later. Thanks again,

-peter.

 


Topic: Re: ClipCatch receives all text from ClipBoard (7 of 19), Read 57 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 16, 2004 08:33 AM

On Fri, 09 Apr 2004 18:35:00 -0400, Peter Rejto wrote:

>Incidentally, Reg_Set(52, CLIPCATX2) or something like that did catch my eyes.
>I can not copy and paste for an exact quotation. My question is the X versus H.

I tried to incorporate several possibilities for calling formatting
commands.

1.) The builtin ones
2.) The USRFORMAT subroutine
3.) An external macro which is called

CIPCATCX2.VDM is simply the default macro name for 3.) and can be
changed in the startup dialog.

The "X" in the name was meant as "eXtension":
CLIPCATCH2.VDM - the main macro
CLIPCATCX2.VDM - the extension macro
(You see it?)

First I named it CLIPCATCH2.VDX (same name as the main macro but
another extension). But that is a new extension, unknown to Windows
and the user, and therefore a doubleclick in Explorer wouldn't call
VEDIT to edit the file.
So I discarded that way and changed the filename.

With a default extension macro for the formatting you are able to
create and fill that macro with your commands (or macro calls) without
having to modify the main macro every time!

The Reg_Set(52, "CLIPCATCX2.VDM") just sets that default (like the
other default values there) and of course can be changed.

Hope to have brought some light into it...

I fixed some loading problems regarding the external macro.
Please download the new version.
http://ziemski.privat.t-online.de/vedit/macros/clipcatch.vdm

Christian

 


Topic: Re: ClipCatch receives all text from ClipBoard (8 of 19), Read 57 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Saturday, April 10, 2004 12:05 PM

On 4/10/2004 6:07:18 AM, Christian Ziemski wrote:
>On Fri, 09 Apr 2004 18:35:00 -0400,
>Peter Rejto wrote:
>
>>Incidentally, Reg_Set(52, CLIPCATX2) or something like that did catch my eyes.
>>I can not copy and paste for an exact quotation. My question is the X versus H.
>
>I tried to incorporate several
>possibilities for calling formatting
>commands.
>
>1.) The builtin ones
>2.) The USRFORMAT subroutine
>3.) An external macro which is called
>
>CIPCATCX2.VDM is simply the default
>macro name for 3.) and can be
>changed in the startup dialog.
>
>The "X" in the name was meant as
>"eXtension":
> CLIPCATCH2.VDM - the main macro
> CLIPCATCX2.VDM - the extension macro
>(You see it?)

Christian;

Yes, I do see it! At the same time, please note that I see it after it has been explained to me and not before. I just do not have the programming background and something that is perfectly obvious with such a background it is not at all obvious to me.

I am sure glad that you made the X-extension adjustment in the filename and not in the extension-name. I am really afraid of exceptions. I simply can not keep track of them.

Let me ask another notational question. Somehow Clip_Catch
would seem to fit the Reg_Set scheme more that ClipCatch.

I appreciate the new version and I am going to download it right away.

peter.

 


Topic: Re: ClipCatch receives all text from ClipBoard (9 of 19), Read 58 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Saturday, April 10, 2004 12:31 PM

Peter:

Some minutes ago you wrote:

>On 4/10/2004 6:07:18 AM, Christian Ziemski wrote:
>>The "X" in the name was meant as "eXtension":
>> CLIPCATCH2.VDM - the main macro
>> CLIPCATCX2.VDM - the extension macro
>>(You see it?)
>
>Yes, I do see it! At the same time, please note that I see it after it has been
>explained to me and not before. I just do not have the programming background
>and something that is perfectly obvious with such a background it is not at all
>obvious to me.

Understandable. But I'm not a writer of prosa ;-).
So docu and advertisement come late after the coding.
(Inline comments are always there, of course.)

And VEDIT is still only a "hobby" for me. A big one, I have to admit.

So some problems have to be solved in discussion.


>Let me ask another notational question. Somehow Clip_Catch
>would seem to fit the Reg_Set scheme more that ClipCatch.

The names with underscore are VEDIT internal commands, like Reg_Set().

ClipCatch is a filename. And there I try to follow Ted's way of short
names and most times without special characters.
Ted usually uses 8.3 filenames to be compatible with the DOS VEDIT.
I sometimes break the 8.3 rule.
Since Ted wrote that he plans to discontinue the DOS version (IIRC),
those longer filenames shouldn't be so bad in the future.

>I appreciate the new version and I am going to download it right away.

Since I uploaded another fixed version just now, please repeat your
download.

Christian

 


Topic: Re: ClipCatch receives all text from ClipBoard (10 of 19), Read 53 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Sunday, April 11, 2004 05:49 PM

On 4/10/2004 12:31:19 PM, Christian Ziemski wrote:
>Peter:

Christian,


>>Let me ask another notational question. Somehow Clip_Catch
>>would seem to fit the Reg_Set scheme more that ClipCatch.
>
>The names with underscore are VEDIT
>internal commands, like Reg_Set().
>
>ClipCatch is a filename

Thanks, I got it.





>Since I uploaded another fixed version
>just now, please repeat your
>download.
>
I shall do it right now.

Thanks,

-peter.

 


Topic: Re: ClipCatch receives all text from ClipBoard (11 of 19), Read 48 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Monday, April 12, 2004 06:13 PM

On 4/10/2004 12:31:19 PM, Christian Ziemski wrote:
>Peter:
>

>Since I uploaded another fixed version
>just now, please repeat your
>download.

Christian:

Thanks for sharing your impressive macro with me.

Now I would like to give you a progress report: Among other things, I have used it to copy the Table of Contents of the Macro Language Manual to my pr_vpw.tpl, file. It just worked fine!

Since, I hope that other Vedit users will also find this file useful, I am uploading it. Mainly it consist of example macros from the Manual which can be launched. The "short name" of the example is the number of the subsection in the Table of Contents.

Incidentally, I found a possible typo in one of the 3.2.7 subsection examples, which I marked. I would appreciate your looking at it.

Thanks for everything.

-peter.

 
Examples from the Vedit Macro Manual.

 


Topic: Re: ClipCatch receives all text from ClipBoard (12 of 19), Read 46 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Tuesday, April 13, 2004 03:31 AM

On 4/12/2004 6:13:20 PM, Peter Rejto wrote:

>Incidentally, I found a possible typo in one of the 3.2.7 subsection examples,
>which I marked. I would appreciate your looking at it.


Yes, there is a typo.
In chapter 3 / page 68 there are two pairs of curly braces missing.


The original


if ( Search("teeth")==0 ) goto error1
...
error1:
Message('Cannot find "teeth".\n')
Search("teeth")
if (Error_Match) goto error1
...
error1:
Message('Cannot find "teeth".\n')


should read:


if ( Search("teeth")==0 ) { goto error1 }
...
error1:
Message('Cannot find "teeth".\n')
Search("teeth")
if (Error_Match) { goto error1 }
...
error1:
Message('Cannot find "teeth".\n')


But you already found the solution by yourself.

Christian

 


Topic: Re: ClipCatch receives all text from ClipBoard (13 of 19), Read 43 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Tuesday, April 13, 2004 10:22 AM

At 03:27 AM 4/13/2004, you wrote:
>Yes, there is a typo.
>In chapter 3 / page 68 there are two pairs of curly braces missing.

I will fix this in the next revision of the manual.

Ted.

 


Topic: Re: ClipCatch receives all text from ClipBoard (14 of 19), Read 34 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Wednesday, April 14, 2004 07:57 AM

On 4/9/2004 1:12:21 PM, Christian Ziemski wrote:
>
>() quoting all lines with character(s) below
>() removing empty lines and building a paragraph
>() compressing whitespace to single space

Maybe these three options should be tick boxes instead of radio buttons. I don't think there is need for these options to be mutually exclusive.


BTW, while testing this macro, I noticed once more that Vedit handles a macro call as a single edit operation.
If you press Undo after executing the macro, all
the text inserted is immediately deleted.
Ted, I wonder if it is possible from a macro to insert a kind of undo break? So that for example in this case, each inserted line could be undone separately?

--
Pauli

 


Topic: Re: ClipCatch receives all text from ClipBoard (15 of 19), Read 34 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Wednesday, April 14, 2004 08:31 AM

On 4/14/2004 7:57:01 AM, Pauli Lindgren wrote:
>>() quoting all lines with character(s) below
>>() removing empty lines and building a paragraph
>>() compressing whitespace to single space
>
>Maybe these three options should be tick boxes instead of radio buttons. I don't
>think there is need for these options to be mutually exclusive.

Yes, you are right. I'll change the code.


>Ted, I wonder if it is possible from a macro to insert a kind of undo break?
>So that for example in this case, each inserted line could be undone
>separately?

The macro does one single Reg_Ins() to insert a text block.
Not line per line (in the case you meant "line" literally).

I'll have a look at the Undo-Feature in my macro.


Christian

 


Topic: Re: ClipCatch receives all text from ClipBoard (16 of 19), Read 38 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 16, 2004 08:35 AM

Here is the new version.

The main formatting options are now checkboxes and no longer radio buttons. So you can combine them at will.

BTW: I now disabled the undo while the macro is running.

http://ziemski.privat.t-online.de/vedit/macros/clipcatch.vdm

Christian

Note:
I changed the name of the macro from clipcatch2 to clipcatch at 04/16/2004

 


Topic: Re: ClipCatch receives all text from ClipBoard (18 of 19), Read 30 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, April 16, 2004 12:10 AM

At 10:33 AM 4/14/2004, you wrote:
>Here is the new version.
>
>The main formatting options are now checkboxes and no longer radio buttons. So you can combine them at will.
>
>BTW: I now disabled the undo while the macro is running.

Thank you for the improved macro.
I just implemented {MISC, More macros, CLIPCATCH}.

I changed references to "CLIPCATCX2" to "CLIPCATCHX"; I don't think we
need the version number included in the macro name.

Ted.

 


Topic: Re: ClipCatch receives all text from ClipBoard (19 of 19), Read 29 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, April 16, 2004 02:41 AM

On 4/16/2004 12:10:28 AM, Ted Green wrote:
>Thank you for the improved macro.
>I just implemented {MISC, More macros, CLIPCATCH}.
>
>I changed references to "CLIPCATCX2" to "CLIPCATCHX";
>I don't think we need the version number
>included in the macro name.

Of course not. I added the version number to have a parallel
fork of the original CLIPCATCH.VDM until a reaction of you. ;-)

Now I'll drop the "primitive" version and replace it with the new one.

Since I don't know the point in time you downloaded the macro: I changed some bits at 04/15/2004 09:29 GMT.

And now I renamed it too:

http://ziemski.privat.t-online.de/vedit/macros/clipcatch.vdm

Christian

 


Topic: Re: ClipCatch receives all text from ClipBoard (17 of 19), Read 32 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Wednesday, April 14, 2004 01:08 PM

At 07:53 AM 4/14/2004, you wrote:
>BTW, while testing this macro, I noticed once more that Vedit handles a macro call as a single edit operation.
>If you press Undo after executing the macro, all
>the text inserted is immediately deleted.
>Ted, I wonder if it is possible from a macro to insert a kind of undo break? So that for example in this case, each inserted line could be undone separately?

Yes, it would be trivial to implement a command which "closes" one undo operation.

Ted.