Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 06, 2016, 10:01:15 AM
  • Proudly celebrating 10 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: Request: Modify Format/Case, order of rules, etc.  (Read 1783 times)

kunkel321

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 464
    • View Profile
    • Donate to Member
Request: Modify Format/Case, order of rules, etc.
« on: June 18, 2015, 02:03:22 PM »
Hi Mouser,  I've been using the Modify Format/Case features of CHS quite a bit lately.   
I'm not sure if it is something you are working on lately; but here are some feature ideas for your list   :D

I've found that it would be nice if I could dictate which rules get applied first.  For example in one of my presets I might like to "Add Stuff" to the beginning and ending of each line before I "Find and Replace" content; but other times I might want to do it after.  I've been trying to think about what the GUI for this would look like....   
[will do an "edit" to this post later]

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Request: Modify Format/Case, order of rules, etc.
« Reply #1 on: June 18, 2015, 02:35:29 PM »
it's an issue i have considered...

an interface to do such things would be pretty clear, it would involve creating a LIST of transformations, where the user can add, re-arrange, delete, transformation items.  such processes can be seen in some file renamers and probably some other text manipulators.

it's something i considered.. the problem is that while such an approach is much more flexible and comprehensive, and indeed extensible, there is a real price to be paid in terms of ease of use for quick things.  so in the end i chose this approach, and left more complicated manipulations to external scripts that can be triggered.

kunkel321

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 464
    • View Profile
    • Donate to Member
Re: Request: Modify Format/Case, order of rules, etc.
« Reply #2 on: June 18, 2015, 02:56:12 PM »
Actually I just found this...

[FormattingForm.rsPropSaver1]
acCheckGroupBoxAddEntire.Checked="false"
acCheckGroupBoxHotkey.Checked="true"
acCheckGroupBoxRunTool.Checked="false"
acCheckGroupBoxSortAndPrune.Checked="false"
...
TrimRightCountEdit.Value=0


Muah ha ha ha <mad scientist laughter>

As you might guess, I took the .preset.format file from C:\Program Files\Clipboard Help+Spell\MyConfigDir\PresetFormats and changed the extension to ".txt" in order to open and view the content.

But I'm guessing that if I try to rearrange these items, then change back to .preset.format, I'll probably corrupt the file -- yes?

=========
EDIT:
 Actually, I see that the script tool does allow you to activate it "before" or "after" other formatting, so that's cool.   :D

Question: What script engines have folks been calling with this tool?  Mostly AutoHotkey .exe files, I would imagine.  

Thot: The above "hacked" file contents are more user-friendly than an external script, in some respects, because the syntax is already there...  It's sortof like doing VBA Macros in Word.  If I had to make the VBA module from scratch, I honestly wouldn't know where to start.  So I always "record" a macro to get the bare bones, then edit the code that Word provides....

======
EDIT 2:
  Actually I opened a copy of the C:\Program Files\Clipboard Help+Spell\Tools\chs_sampletool2.pl file, and it does appear to be a text file. 
What cryptic alien language is this though?

# check and get commandline args
($#ARGV >=1) || die "ERROR: first two arguments should be input path and output path (place each one in double quotes)\n";
$infilepath=$ARGV[0];
$outfilepath=$ARGV[1];

# open files
open(IN,$infilepath) || die "cannot open input file";
open(OUT,">".$outfilepath) || die "cannot open output file";

# write out modified text
while(<IN>)
   {
   # remove newline which is unpredictable
   chomp($_);
   # reverse the line
   $outline = reverse($_);
   # now write it out with predictable newline at end
   print OUT $outline . "\n";
   }

# close files
close(IN);
close(OUT);


Also, the ".pl" files don't show up in the script tool file picker dialog....
« Last Edit: June 18, 2015, 03:18:01 PM by kunkel321 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Request: Modify Format/Case, order of rules, etc.
« Reply #3 on: June 18, 2015, 05:32:11 PM »
.pl is perl :)

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,139
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Request: Modify Format/Case, order of rules, etc.
« Reply #4 on: June 19, 2015, 05:16:40 AM »
Unwitting humour? I liked this exchange - a LOL moment for me:
...What cryptic alien language is this though?
______________________

.pl is perl :)
______________________

@kunkel321's question was spot-on:
Quote
PERL...In 1998, it was also referred to as the "duct tape that holds the Internet together", in reference to both its ubiquitous use as a glue language and its perceived inelegance. - Wikipedia.

But yet there are those amongst us who work magic by speaking a secret alien language, unknown to uninitiated, later generations.

kunkel321

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 464
    • View Profile
    • Donate to Member
Re: Request: Modify Format/Case, order of rules, etc.
« Reply #5 on: June 19, 2015, 06:05:07 PM »
So is the .pl file a resource for the .exe or something?