Discussion:
Convert case macro
(too old to reply)
Craig Schiller
2004-09-06 19:36:52 UTC
Permalink
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?

TIA,
Craig
lemoto
2004-09-06 19:56:20 UTC
Permalink
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
While we wait for an off-the shelf macro, please:
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of the
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Craig Schiller
2004-09-06 20:01:12 UTC
Permalink
Roy -

I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.

Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of the
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Barry MacDonnell
2004-09-07 01:46:57 UTC
Permalink
This should do the job. It will convert the first letter of a selected block
of text to UPPER case and all other characters to LOWER case.

// macro begins

If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit

// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of the
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Craig Schiller
2004-09-07 18:13:49 UTC
Permalink
Thanks, Barry. Not to be too greedy, but what would a version that could do
multiple lines (that end in a HRt) look like?

Craig
Post by Barry MacDonnell
This should do the job. It will convert the first letter of a selected block
of text to UPPER case and all other characters to LOWER case.
// macro begins
If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit
// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of the
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Barry MacDonnell
2004-09-07 20:52:46 UTC
Permalink
The macro will work on a block of any size. It merely applies lower case to
the selected text, then goes to the beginning of the selection and converts
the first word back to initial caps. Try it.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Thanks, Barry. Not to be too greedy, but what would a version that could do
multiple lines (that end in a HRt) look like?
Craig
Post by Barry MacDonnell
This should do the job. It will convert the first letter of a selected block
of text to UPPER case and all other characters to LOWER case.
// macro begins
If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit
// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of the
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Craig Schiller
2004-09-07 21:59:08 UTC
Permalink
Barry -

Yes, but imagine a table of contents, which is the text I'd like to use this on,
as I mentioned earlier. I select 8 entries, i.e., 8 lines. Only the very first
word will be capitalized, rather than the first word of each line. Of course, I
could select each line individually, but that will be a very large number of
lines --- the sort of thing a macro is ideal for. :-)

Craig
Post by Barry MacDonnell
The macro will work on a block of any size. It merely applies lower case to
the selected text, then goes to the beginning of the selection and converts
the first word back to initial caps. Try it.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Thanks, Barry. Not to be too greedy, but what would a version that could
do
Post by Craig Schiller
multiple lines (that end in a HRt) look like?
Craig
Post by Barry MacDonnell
This should do the job. It will convert the first letter of a selected
block
Post by Craig Schiller
Post by Barry MacDonnell
of text to UPPER case and all other characters to LOWER case.
// macro begins
If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit
// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of
the
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by lemoto
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Barry MacDonnell
2004-09-07 23:34:15 UTC
Permalink
You said,

"multiple lines (that end in a HRt)"

not,

"multiple lines (that EACH end in a HRt)"

Anyway, this would require stepping through each "sentence." You could
modify one of my STEPPER macros
(http://home.earthlink.net/~wptoolbox2/Library/Stepper.html) and add the
code I posted here.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Barry -
Yes, but imagine a table of contents, which is the text I'd like to use this on,
as I mentioned earlier. I select 8 entries, i.e., 8 lines. Only the very first
word will be capitalized, rather than the first word of each line. Of course, I
could select each line individually, but that will be a very large number of
lines --- the sort of thing a macro is ideal for. :-)
Craig
Post by Barry MacDonnell
The macro will work on a block of any size. It merely applies lower case to
the selected text, then goes to the beginning of the selection and converts
the first word back to initial caps. Try it.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Thanks, Barry. Not to be too greedy, but what would a version that could
do
Post by Craig Schiller
multiple lines (that end in a HRt) look like?
Craig
Post by Barry MacDonnell
This should do the job. It will convert the first letter of a selected
block
Post by Craig Schiller
Post by Barry MacDonnell
of text to UPPER case and all other characters to LOWER case.
// macro begins
If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit
// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply act on
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a previous
non-capitalization, call the macro, and have it find the start of
the
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by lemoto
current sentence and fix things?
- is the macro to run through a whole document, fixing as it goes?
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Craig Schiller
2004-09-08 17:23:01 UTC
Permalink
Barry -

Sorry for my confusing syntax! Got it mostly working now. Thanks!

Craig
Post by Barry MacDonnell
You said,
"multiple lines (that end in a HRt)"
not,
"multiple lines (that EACH end in a HRt)"
Anyway, this would require stepping through each "sentence." You could
modify one of my STEPPER macros
(http://home.earthlink.net/~wptoolbox2/Library/Stepper.html) and add the
code I posted here.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Barry -
Yes, but imagine a table of contents, which is the text I'd like to use
this on,
Post by Craig Schiller
as I mentioned earlier. I select 8 entries, i.e., 8 lines. Only the very
first
Post by Craig Schiller
word will be capitalized, rather than the first word of each line. Of
course, I
Post by Craig Schiller
could select each line individually, but that will be a very large number
of
Post by Craig Schiller
lines --- the sort of thing a macro is ideal for. :-)
Craig
Post by Barry MacDonnell
The macro will work on a block of any size. It merely applies lower case
to
Post by Craig Schiller
Post by Barry MacDonnell
the selected text, then goes to the beginning of the selection and
converts
Post by Craig Schiller
Post by Barry MacDonnell
the first word back to initial caps. Try it.
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Thanks, Barry. Not to be too greedy, but what would a version that
could
Post by Craig Schiller
Post by Barry MacDonnell
do
Post by Craig Schiller
multiple lines (that end in a HRt) look like?
Craig
Post by Barry MacDonnell
This should do the job. It will convert the first letter of a
selected
Post by Craig Schiller
Post by Barry MacDonnell
block
Post by Craig Schiller
Post by Barry MacDonnell
of text to UPPER case and all other characters to LOWER case.
// macro begins
If(?BlockActive) // if something is selected
ConvertCaseLowercase
PosBlockTop
SelectWord
ConvertCaseInitialCaps
SelectOff
Endif
Quit
// macro ends
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Roy -
I'd be a happy camper if I could find a macro that would simply
act on
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
selected text. Certainly not an as-you-type thing.
Craig
Post by lemoto
- is this to happen as you type?
- is this to happen on command? - ie: you would notice a
previous
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by lemoto
non-capitalization, call the macro, and have it find the start
of
Post by Craig Schiller
Post by Barry MacDonnell
the
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by lemoto
current sentence and fix things?
- is the macro to run through a whole document, fixing as it
goes?
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by Barry MacDonnell
Post by Craig Schiller
Post by lemoto
- would a <capitalize initial letter of current word> do?
--
Good wishes!
Roy Lewis
Charles Rossiter
2004-09-07 05:48:09 UTC
Permalink
Craig,

With standard settings in QuickCorrect, Format-as-you-Go, just select
the text for conversion and do Edit, ConvertCase, Lower case. The first
characters in all the sentences are left in upper case.
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
TIA,
Craig
--
Charles Rossiter
(South Africa)
Volunteer C_Tech
{Please reply to group only}
Craig Schiller
2004-09-07 16:30:32 UTC
Permalink
Charles -

Unfortunately, that only works when the selected text is in sentences. Mine
isn't (it's in a table of contents). Thanks for the thought.

Craig
Post by Charles Rossiter
Craig,
With standard settings in QuickCorrect, Format-as-you-Go, just select
the text for conversion and do Edit, ConvertCase, Lower case. The first
characters in all the sentences are left in upper case.
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
TIA,
Craig
--
Charles Rossiter
(South Africa)
Volunteer C_Tech
{Please reply to group only}
Wayne Templin
2004-09-07 17:13:12 UTC
Permalink
You can add macro buttons to your tool bar to change the case of sentences.
Right click on the toolbar, go to edit, go to "file" in the features
category and pick "lower case", "UPPER CASE" and "initial caps" to add the
buttons to the toolbar.

Then, you can select a line or paragraph of text, click on the UPPER CASE
button and then immediately click on the lower case button and you'll have
the first word in each sentence capitalized. You will need to review the
changed text to make sure that words that should be capitalized are
capitalized.

This is a quick way to do this if you don't want to take the time to write a
macro. Plus, you will have three useful buttons added to your toolbar.

WT
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
TIA,
Craig
Craig Schiller
2004-09-07 17:17:19 UTC
Permalink
Wayne -

As I said to Charles, this only works for text in sentences. But thanks for
trying.

Craig
Post by Wayne Templin
You can add macro buttons to your tool bar to change the case of sentences.
Right click on the toolbar, go to edit, go to "file" in the features
category and pick "lower case", "UPPER CASE" and "initial caps" to add the
buttons to the toolbar.
Then, you can select a line or paragraph of text, click on the UPPER CASE
button and then immediately click on the lower case button and you'll have
the first word in each sentence capitalized. You will need to review the
changed text to make sure that words that should be capitalized are
capitalized.
This is a quick way to do this if you don't want to take the time to write a
macro. Plus, you will have three useful buttons added to your toolbar.
WT
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
TIA,
Craig
Barry MacDonnell
2004-09-07 18:07:22 UTC
Permalink
Have you tried the macro I posted above?
--
<< Barry >>
Barry MacDonnell's Toolbox for WordPerfect
Free WordPerfect macros, tips, etc., at -
http://home.earthlink.net/~wptoolbox
(E-mail via the Contact page on my site)
Post by Craig Schiller
Wayne -
As I said to Charles, this only works for text in sentences. But thanks for
trying.
Craig
Post by Wayne Templin
You can add macro buttons to your tool bar to change the case of sentences.
Right click on the toolbar, go to edit, go to "file" in the features
category and pick "lower case", "UPPER CASE" and "initial caps" to add the
buttons to the toolbar.
Then, you can select a line or paragraph of text, click on the UPPER CASE
button and then immediately click on the lower case button and you'll have
the first word in each sentence capitalized. You will need to review the
changed text to make sure that words that should be capitalized are
capitalized.
This is a quick way to do this if you don't want to take the time to write a
macro. Plus, you will have three useful buttons added to your toolbar.
WT
Post by Craig Schiller
Can anyone point me in the direction of a macro that changes case
similarly to (gasp!) Word's Sentence Case function? That is, text is
converted so that the first and only the first word of a sentence is
capitalized?
TIA,
Craig
Loading...