ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Clipboard Help+Spell

CHS: Share your custom modification scripts here

(1/2) > >>

mouser:
Building off of the screencast video here, and a recent discussion on using scripts to transform text here, i thought maybe it would make sense to have a thread where people might share their Clipboard Help+Spell scripts and executables for transforming text.

NOTE: You currently need to download the ALPHA RELEASE of CHS 2.09.01 to use these tools.


I'm going to start with this sample perl script that does nothing but reverse the order of characters on each line of text.  This is not useful in and of itself, but it does serve as a skeleton for those who might want to write perl scripts for Clipboard Help+Spell.  This sample script file is included with the new version of CHS (v2.09.01) in the tools folder.  Note that you need to have perl installed and configured on your pc to use perl .pl scripts directly from Clipboard Help+Spell:

--- Code: Perl ---# 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 filesopen(IN,$infilepath) || die "cannot open input file";open(OUT,">".$outfilepath) || die "cannot open output file"; # write out modified textwhile(<IN>)        {        # reverse the line        $outline = reverse($_);        # now write it out        print OUT $outline;        } # close filesclose(IN);close(OUT);

Next up is a link where you can download the C++ source code for a C++ tool that does a similar thing -- takes input and output file paths on commandline and performs a text transformation:
https://www.donationcoder.com/Software/Mouser/clipboardhelpandspell/downloads/chs_sampletool.zip

This was built using visual studio 2010, but it's plain ordinary c++ that can be compiled with any c++ compiler.


So, anyone got any to share?

IainB:
Is it possible to trigger these scripts to run automatically on the contents of a clip, each time a new clip record is captured?

mouser:
no, though i suppose i could add such a feature if there was a use for it.

capitalH:
Runs current selection as AHK code (i.e. creates tempfile with .ahk extension and runs it)

Requires autohotkey to be installed, and associated with .ahk files

Since users of this will know AHK - I will assume that no further explanation is required.


--- Code: Autohotkey ---if %0%<=1                                       ;only run if two parameters given        exitapp        infile=%1%                              ;infile first paramateroutfile=%2%                             ;outfile second parameter ;read contents of InFileFileRead, InFileContents, %Infile% SplitPath, OutFile , OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive ;delete old ahk file - using appendFileDelete, %OutDir%\%OutNameNoExt%.ahk ;create new ahk fileFileAppend , #SingleInstance force`n`n%inFileContents%`n`n`n`n ~esc::ExitApp, %OutDir%\%OutNameNoExt%.ahk ;copies infile to outfile - otherwise an error will occur (or alternatively if outfile already exist - old stuff will pe pasted)FileCopy, %InFile%, %OutFile%,1 ;run ahk coderun   %OutDir%\%OutNameNoExt%.ahk

mouser:
Very neat  :up:

Navigation

[0] Message Index

[#] Next page

Go to full version