Full Version: Character Counter

From: Harvey only (HARVEY-ONLY) [#1]
 19 Jul 2006
To: ALL

From another post.

From: Carl (CSEWELL) 12:55
To: ALL 2 of 2

4364.2 In reply to 4364.1
Thanks David.

Okay, here's the first one. USE AT YOUR OWN RISK! It has been successfully installed and executed in version 12 of CorelDraw.

It's a simple character counter. If you charge by the letter, this macro will verify your count. Select the text that you want to count the letters in and then run the macro. A pop-up window will display the number of characters found. It does not count CR (carriage returns) or LF (line feeds).

And here is information on installing the macro and also adding a macro as command button to your toolbox toolbar (or where ever you'd like it).

It's fairly easy to implement an existing macro

- Make sure there are no copies of CorelDraw running.
- Copy the GMS file to the CorelDraw GMS folder, usually: C:\Program Files\Corel\Corel Graphics 12\Draw\GMS
- Start Corel and go to Tools> Visual Basic > Play
- Towards the bottom of the pop-up window you'll see "Macros in:". Select the arrow down at the end of the text box on that line.
- Click on the macro you'd like to run.
- The macro name will be placed in the text box under Macro Name.
- Click on Run.


You can also add the macro as a command on a toolbar, which isn't the easiest thing to do, but we're talking minutes and not hours to implement. I have a flyout specifically for macros. It's fairly straight forward and once you do it, it is fairly intuitive. To add a command button for a macro to the Toolbox toolbar:

- Right click anywhere on the toolbox toolbar and follow Customize> Toolbox Toolbar> and then click on Add a new command
- In the new window, just below the word Command (top center of the new window) is a text box with File. Click on the down arrow and find and select Macros (it's at the top of the list).
- In the text list box below, find the macro that you want to add as a command button and click on it ONCE.
- You can add a tool tip (see box to the right) under the GENERAL tab.
- Or use a shortcut key for it under the SHORTCUT KEYS tab
- Click on the Appearance tab.
- Here you can change the ICON by IMPORTing one or drawing your own!
- You may want to change the caption (above the ICON) to something simpler than what is displayed.
- Once you get all that done (and you can come back and modify this later), left click (hold down the mouse button) on the macro name in the list box (to left of the tabs section, where you first clicked on it above) and drag it to the toolbox toolbar. Or wherever you want.
- You can undo the command button by dragging it back to where you dragged it from.
- You can go back and modify the icon or tooltip without having to drag it to the toolbar again.

The macro and the associated code is FREE to use and distribute as you please. If you make any money off of it, please send at least half to me. ;^)

{David, should this be a new thread, with "Count Characters" or "Count Letters" as the Thread title?}


Carl


http://www.engravingetc.org/forum/getattachment.php?webtag=EE&hash=6c6d0c7e1fe1b05f2f518abc53eb430a

EDITED: 20 Jul 2006 by DGL


From: PenTrophy (PENINSULATROPHY) [#2]
 19 Jul 2006
To: Harvey only (HARVEY-ONLY) [#1] 20 Jul 2006

I still use Corel9 and under TEXT - "Text Statistics" gives you a lines, words, characters and fonts used block...

From: John (ICTJOHN) [#3]
 19 Jul 2006
To: PenTrophy (PENINSULATROPHY) [#2] Unread

Mark,

That is handy to know.............it is still in there for CorelDRAW X3 as well.


From: Carl (CSEWELL) [#4]
 19 Jul 2006
To: PenTrophy (PENINSULATROPHY) [#2] Unread

The TEXT Statistics includes TABs and SPACES in the character count. The character count macro excludes TABs and SPACEs. The ASCII range for the macro is 32 to 127 (non-inclusive).

Do you charge for TABs and SPACEs? I guess I need to rethink my pricing scheme.... AGAIN! Figuring a space for every word with an estimated average length of 5 characters per word, that would be about a 20% increase in sales!

Thanks! I've got some back-billing to get out.

From: Carl (CSEWELL) [#5]
 20 Jul 2006
To: Harvey only (HARVEY-ONLY) [#1] 20 Jul 2006

Harvey;

Would you please correct the spelling on this thread title (change the 'o' to an 'e' in Character) or modify the search feature so that it will accept and search for all possible misspellings? Either one would be fine with me. I'll leave the choice up to you. ;^)

Thanks.

From: Stunt Engraver (DGL) [#6]
 20 Jul 2006
To: Carl (CSEWELL) [#5] 20 Jul 2006

Carl,

I'm usually very good at catching the typos. Never saw that one. :-) 

From: Carl (CSEWELL) [#7]
 20 Jul 2006
To: Stunt Engraver (DGL) [#6] 20 Jul 2006

quote:
I'm usually very good at catching the typos.


I guess we can't count on you any more, even though you are a character.

Thanks.

From: Stunt Engraver (DGL) [#8]
 20 Jul 2006
To: Carl (CSEWELL) [#7] 20 Jul 2006

Carl,

Fortunately, for me, there's no impeachment process here. :-) 

From: Carl (CSEWELL) [#9]
 20 Jul 2006
To: Stunt Engraver (DGL) [#8] 20 Jul 2006

Your successor is probably happy about that also!

From: Pedaler (ROYBREWER) [#10]
 23 Jul 2006
To: Carl (CSEWELL) [#4] 23 Jul 2006

All,

BTW, it works fine under X3.

Thanks for sharing, Carl.

Back to thread list | Login

© 2024 Project Beehive Forum