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

<< < (2/2)

IainB:
@capitalH: (Your script.) Yes, rather neat. Thanks. Could be a useful shortcut for testing bits of AHK code.   :Thmbsup:

@mouser:
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?
--- End quote ---

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

Well, if the feature existed, this is an example of a repetitive task that I would use it for:
What I would like to be able to do is select (enable) a script that automatically inserts a string of text of my choosing into each sucessive clip taken, until I disable it. This would be an optional "run until" model - it differs to the current model which is (if I have it aright) where you manually select a script to "run once" only.

Thus, if I were (say) gathering clips on the subject of Deming, then I could use the string "extract Deming", so that every clip could have the string "extract Deming" appended to it - whether it originally contained the word or not. Then, I could subsequently use an SQL filter to collect all the occurrences of clips with "extract Deming" into a Virtual Folder. Once they were in the VF, I could then do whatever I wanted with them - e.g., (say) concatenate them as a set of contiguous notes, for pasting elsewhere.

Does that make sense?

capitalH:
I created a RegEx preset - and since I spent a long time trying to figure out how to do it (RegEx is something I still struggle with), I though I will share

What I want to do: create presets that comments code out (and next up uncomments it as well) for AHK, Latex and Python - however since only the comment character differs the implementation follow naturally from the first (AHK given in example):
for example, to change:

--- ---Line 1
 Line 2 ;space
Line 3 ;tab
  Line 4 ;2space
Line 5 ;2tab
;  Line 6 ;already commented
; Line 7 ;already commented
;Line 8 ;already commented, with indent
to:

--- ---;Line 1
; Line 2 ;space
; Line 3 ;tab
;  Line 4 ;2space
; Line 5 ;2tab
;  Line 6 ;already commented
; Line 7 ;already commented
; ;Line 8 ;already commented, with indent
(off topic - you might not want to double comment Line 8 - but this is the way I prefer it )

you can use
Add Stuff|Add to Lines|Prefix : ";" (obviously without the quotes

Find and replace - enable RegEx
Find "^[;;]" (no quotes)
Replace "" (empty string - no quotes)

The RegEx prevents Line 6 and 7 from being double commented (and subsequently upon running this twice or more - maybe with a wider selection - prevents endless comment characters)

To remove
Trimming and Wrapping|Strip Leading Stuff|";"

Mouser - is there somehow that the internal stuff (i.e. presets not using custom tools) like this can be packaged as part of an add-on for CHS? Or packaged with CHS and then have a preset manager where you can delete/disable/enable the unneeded ones. I am more than willing to share my files (stuff like paragraph stripping - for copying from Adobe reader etc - but nothing fancy).

ewemoa:
Put a little utility together that displays a pop-up menu of AHK_L scripts to choose from.  

CHS: Share your custom modification scripts here

Currently, each menu item above the separator corresponds to a single AHK_L script.  Choosing the menu item should lead to the execution of the corresponding script.

Below is source to the current script for trimming:


--- Code: Autohotkey ---ChangeText(InputText){  OutputDebug, % "Before: " . InputText  Result := Trim(InputText)  OutputDebug, % "After: " . Result  Return Result}
To make one's own scripts, basically:


* Make a new file with extension .ahk in the scripts folder
* In the .ahk file, define a function named 'ChangeText' - it should have a single parameter
* In the body of the function, transform the text passed in as desired and use Return to communicate the result to CHS
Installation instructions should be in the README.txt within the archive, but it's pretty much the same as the other custom modification scripts.

MD5: 90eeccc94446f2e8303d82de60af1865
LBA

Note: no compilation of scripts is necessary thanks to AutoHotkey.dll and AHK_L.

cranioscopical:
no, though i suppose i could add such a feature if there was a use for it.
-mouser (October 11, 2011, 07:08 AM)
--- End quote ---
I could see a use for that if you felt like adding it to your list (probably after accessing other clipboard formats ;))
 

cranioscopical:
I created a RegEx preset... I will share-capitalH (October 14, 2011, 03:32 AM)
--- End quote ---
And thank you for doing so, and explaining it.

Navigation

[0] Message Index

[*] Previous page

Go to full version