ZTree.com  | ZEN  | About...  

 Index   Back

[ZEP] new Filter option for pasted text-strings.   [ZEP]

By: Ben Kent       
Date: May 27,2018 at 10:18
In Response to: [ZEP] new Filter option for pasted text-strings. (Bill Kingsbury)

> Instead of complicating the F5 'Fuzzy' Filter option... a new 'F7'
> option would replace 'inter-word characters' with spaces, prior to
> generating the Filter.
>
> ( All 'double-spaces' would immediately be replaced by single-spaces
> -- to prevent double-asterisk Filters, that would result in "Error:
> Invalid filter".)
>


Bill

I would do that using an AutoHotKey macro, something like the below.
If enough people see value in your ZEP, i have no objection to ZTree being updated.


------------------
; Key: Windows-4, Action: Munge clipboard to be pasted into a ZTree filter dialog
#4::ZTreeFilterPaste()
return

ZTreeFilterPaste() {
nCount := 0
sMunged := Clipboard
; Convert separators to space
sMunged := RegExReplace(sMunged, "[\-\_\+\=\'\:\;\<\>\/\\]", " ", nCount, -1, 1)
; Escape send key modifiers
sMunged := RegExReplace(sMunged, "([!#\+\^\{\}])", "{$1}", nCount, -1, 1)
; Remove double spaces
sMunged := RegExReplace(sMunged, " +", " ", nCount, -1, 1
nDelay := A_KeyDelay
nDuration := A_KeyDuration
SetKeyDelay, 5, 10
; "Paste" in the text
SendEvent %sMunged%
; Tidy
SetKeyDelay, %nDelay%, %nDuration%
sMunged := ""
nDelay := ""
nDuration := ""
}
------------------

Ben

920 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 77 users online (0 registered, 77 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 1:10 pm UTC  |  Hits:62,367,730  (20,127 Today )
RSS Feed