topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 5:23 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: 3 Feature Ideas  (Read 16464 times)

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
3 Feature Ideas
« on: December 17, 2011, 02:38 PM »
I just finished watching the 3 screencasts, and I'm even more impressed with this program than before.

Ways that I could see CHS improved, that would also allow me to remove other programs from my system:

1) Text aliases i.e. shortcuts with a trigger that are then replaced by e.g. a much longer block of text.

I currently use Lifehacker's free Texter program for this and it works fine. But they way I look at, the expansions are just text blocks that I've copied like anything else in CHS, and want to be able to recycle quickly because I reuse them often.

Currently you can hack this with favorites but that requires mouse-clicking, while Texter let's me do this with just a few keystrokes.

2) Full-on key logging

Not for nefarious purposes, of course. I'm just tired of losing work because a program crashed and there was no autosave or I forgot to save regularly (which I shouldn't have to do). Yes, keylogging captures backspaces/deletions/etc., but I'd still rather reconstruct work from semi-jumbled text than have to try and recall everything from rote at a moment of extreme frustration.

And to avoid it being used for nefarious purposes, you could add in safeguards such as the captured text not being saved beyond the current session, for example.

3) Shortcuts to send copied content out as a tweet, Facebook status update, etc. with optionally-active built-in url shortening capabilities when a url is included. I'd love to have a submenu in the Popup Paste Menu that would allow me to choose a destination on the fly.

Jacob

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #1 on: December 17, 2011, 03:25 PM »
1) Text aliases i.e. shortcuts with a trigger that are then replaced by e.g. a much longer block of text.

I currently use Lifehacker's free Texter
Text expanders have been thrashed around on DC quite a lot.  The obvious suggestion is Phrase Express, because the basic version is free-for-personal-use, or AutoText Typing Assistant by the same company, which is completely free.  I currently use Typing Assistant, which is payware.  It's easy to add shortcut blocks of text via the clipboard.

2) Full-on key logging
This would almost certainly cause CHS to be flagged as malware.  If you'd like recommendations for free-standing ones, review this DC thread: pls recommend a good benign keylogger.  Keylogging is built into PowerPro.

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #2 on: December 21, 2011, 04:34 AM »
I definitely wouldn't want CHS to be flagged as malware- good point.

4) Word count tool

I'd love to be able to know how many words there are in any copied text items listed in the Main Window, or even as an option to display that information in the Quick Paste Menu for each item that appears there.
« Last Edit: December 21, 2011, 05:50 AM by jshare »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #3 on: December 21, 2011, 05:06 AM »
I definitely would want CHS to be flagged as malware- good point.

Huh :huh: you mean wouldn't I guess?

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #4 on: December 21, 2011, 05:51 AM »
you mean wouldn't I guess?

Doh! Good catch, I fixed it

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #5 on: December 21, 2011, 08:15 AM »
4) Word count tool

I'd love to be able to know how many words there are in any copied text items listed in the Main Window, or even as an option to display that information in the Quick Paste Menu for each item that appears there.

Below is an initial attempt at an LBA script to report line and word count for the current selection -- the result comes up as a dialog box so it doesn't match the request exactly.

Code: Autohotkey [Select]
  1. ChangeText(InputText)
  2. {
  3.   Lines := []
  4.   Pattern := "mO)^(.*)$"
  5.   Start := 1
  6.   LineCnt := 0
  7.   While (True)
  8.   {
  9.     FoundPos := RegExMatch(InputText, Pattern, mObj, Start)
  10.     If (ErrorLevel != 0)
  11.     {
  12.       OutputDebug, % "RegExMatch ErrorLevel: " . ErrorLevel
  13.       SoundBeep
  14.       Return
  15.     }
  16.     If (FoundPos == 0)
  17.     {
  18.       Break
  19.     }
  20.     Start := FoundPos + 1
  21.     Lines.Insert(mObj[1])
  22.     LineCnt := LineCnt + 1
  23.   }
  24.   WordCnt := 0
  25.   WordPattern := "\b\w+"
  26.   Loop, % LineCnt
  27.   {
  28.     Line := Lines[A_Index]
  29.     Start := 1
  30.     While (True)
  31.     {
  32.       FoundPos := RegExMatch(Line, WordPattern, mObj, Start)
  33.       If (ErrorLevel != 0)
  34.       {
  35.         OutputDebug, % "RegExMatch ErrorLevel (2nd call): " . ErrorLevel
  36.         SoundBeep
  37.         Return
  38.       }
  39.       If (FoundPos == 0)
  40.       {
  41.         Break
  42.       }
  43.       Start := FoundPos + 1
  44.       WordCnt := WordCnt + 1
  45.     }
  46.   }
  47.   MsgBox, % "Counted:`n`n"
  48.           . "  " . LineCnt . " line(s)`n`n"
  49.           . "  " . WordCnt . " word(s)"
  50.   Return
  51. }

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #6 on: December 21, 2011, 04:55 PM »
4) Word count tool

Character count is - sort of, I think - already built in.  You have to edit the columns you want shown, check the DataSize one, and make sure it shows up in the grid.  See screenshot.  I'm only guessing that DataSize equates directly to character count, though.  I can't see word count as such.  You could probably use an external program like unix `wc` as a Custom Script Tool, but that wouldn't give you an answer directly inside CHS.
« Last Edit: December 21, 2011, 05:10 PM by rjbull »

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #7 on: December 22, 2011, 03:12 AM »
Below is an initial attempt at an LBA script to report line and word count for the current selection -- the result comes up as a dialog box so it doesn't match the request exactly.

Thanks for this. I tried it and I get "Error reading output file C:\Users\X\Documents\DonationCoder\Clipboard Help+Spell\tmpout.txt after tool run: C:\Program Files (x86)\Clipboard Help+Spell\Tools\word-count.ahk with params "C:\Users\X\Documents\DonationCoder\Clipboard Help+Spell\tmpin.txt" "C:\Users\X\Documents\DonationCoder\Clipboard Help+Spell\tmpout.txt""

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #8 on: December 22, 2011, 03:26 AM »
If you don't mind, would you provide more details on how you configured LBA and the steps you performed that resulted in the error?

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #9 on: December 22, 2011, 01:33 PM »
If you don't mind, would you provide more details on how you configured LBA and the steps you performed that resulted in the error?

Sorry, I had completely ignored the part about LBA. I thought that installing Autohotkey was enough. Now that LBA is setup, I added your script properly and it works. Although I would prefer a result in the Quick Paste Menu, this is definitely a big help already.

Thanks much!

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #10 on: December 22, 2011, 05:07 PM »
I thought that installing Autohotkey was enough. Now that LBA is setup, I added your script properly and it works.

Glad to hear it seems to be working!  I hope the counting is implemented correctly -- I tested a few cases, but please let me know if you find problems.

BTW, installation of AutoHotkey is not necessary -- LBA comes with all necessary pieces (thanks to the AHK folks).

Although I would prefer a result in the Quick Paste Menu, this is definitely a big help already.

If someone can convince mouser of a way for external coders to extend CHS in other appropriate ways, may be there would be something us non-mousers could do ;)

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #11 on: December 23, 2011, 03:26 AM »
BTW, installation of AutoHotkey is not necessary

Cool, just uninstalled it.

Regarding the counting- here's a test using this blog post of mine:

  • Your script on it: 101 lines, 857 words
  • Pasted into Word: 99 lines, 821 words
  • Wordpress: 808 words

I'm not so concerned about the line count, it looks like your script is impacted by the width of the window.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #12 on: December 23, 2011, 03:46 AM »
Thanks for the test data :)

Would you mind sharing which words you started and ended on in making your selection so I can do some testing here?

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #13 on: December 23, 2011, 03:57 AM »
Sure. I actually meant to do that but then forgot as I was compiling the information.

My selection started from the first line "Why you might..." and ended with my signature of "--Jacob Share". One important thing is that when you copy-paste anything from my site, a link back to the site is automatically appended to the pasted text, so you'll need to delete that and the whitespace before it for your results to be consistent.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #14 on: December 23, 2011, 05:43 AM »
Thanks for the further details and warning.  Hope to take a look soon.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #15 on: December 23, 2011, 07:41 PM »
Doing some investigation on what "word count" means...upon reflection it seems clear that there may be different definitions.  Though not conclusive, the following tests with online word counters perhaps indicate bugs, multiple interpretations, and/or duplication.


By the way, when I trid the script posted earlier to this thread, the result I saw was different from your report -- here I saw 842 words in 101 lines.  I did this test by copying the text to a text editor, editing it (based on your warning of the extra text at the end), selecting the result, and running the script on it.

The posted script treats each contraction as two words instead of one.  From searching online it appears that this may be viewed as overcounting.  For the current case, I think that's 18 too many words.

A word with a hypen was also counted as more than one word.  I think the overcounting from that was 3 words.

If those were the only differences, then adjustments would lead to agreement with Word's total of 821 = 842 - (18 + 3).  However, with such limited testing, it seems unsafe to bet that such adjustments would lead to perfect matches for all / most other cases.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #16 on: December 23, 2011, 08:16 PM »
It appears that depending on what web browser is used, what gets included in one's selection may differ.

My initial tests were with Chrome 14.0.x.  Using FF 8.0.1, I see:

interests-resume-cartoon

included in the selection, whereas there does not appear to be anything comparable when selecting with Chrome.

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #17 on: December 24, 2011, 11:32 AM »
Thanks for diving in to this.

Personally, as a WordPress blogger, the count that interests me most is that one but even one that is less than 5% different is fine.

Also, could you add a character count too? Useful for us Twitter users who are limited to 140 characters per message.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #18 on: December 25, 2011, 09:19 PM »
I'm pretty ignorant about WordPress -- do you know if the word counting feature you use is part of the basic functionality of WordPress or if it's some kind of plugin?  Perhaps there is some documentation or  source code that can be consulted -- but to dig any of that up, it might help to have an idea of where to look first :)

Regarding character count, some basic functionality seems doable, but I don't know how much work it might be to try to conform to:

  https://dev.twitter..../counting-characters

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #19 on: December 26, 2011, 02:06 AM »
For WordPress: this is the Trac ticket where Word Count was implemented.

For Twitter: whatever functionality you decide to implement, just try to make it so the official Twitter count is always less than your count. That way, if your count is 140 or less, I know for sure that I won't need to edit the tweet again because Twitter's count will never be higher.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: 3 Feature Ideas
« Reply #20 on: December 26, 2011, 06:19 AM »
Thanks for the WordPress-related link.  

Looking at:

  http://core.trac.wordpress.org/attachment/ticket/4807/word-count3.2.patch

some relevant bits appear to be:

Code: Javascript [Select]
  1. tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' );
  2.        tx.replace( /\S\s+/g, function(){tc++;} );

quoted code may be garbled
Not sure how to get the forums to accept the original code...


A brief glance suggests that after dropping characters from a certain set, a count is made of sequences of a non-space character followed by one of more space characters.

My current testing code takes a vaguely similar approach of trying to drop certain characters before attempting a count of modified text.

I'm having difficulty getting things to work out at the moment and it seems to have to do with the use of instances of the UTF-8 "RIGHT SINGLE QUOTATION MARK" that appear to be in your posts (e.g. see the word "don't" in the first sentence of the sample selection).  I'm not confident yet what the difficulty I am experiencing is, but it may have to do with Clipboard Help and Spell not being Unicode aware:

  https://www.donationcoder.com/forum/index.php?topic=24979.msg250346#msg250346

jshare

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 51
    • View Profile
    • JobMob
    • Read more about this member.
    • Donate to Member
Re: 3 Feature Ideas
« Reply #21 on: December 26, 2011, 09:53 AM »
Doh! Well I don't expect you to compensate for the lack of UTF-8. Maybe Mouser's planning on making CHS UTF-8 aware and we can revisit this then.