ZTree.com  | ZEN  | About...  

 Index   Back

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

By: Ben Kent       
Date: May 27,2018 at 06: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

235 views      
Thread locked
 

Messages in this Thread

 
94,426 Postings in 11,918 Threads, 348 registered users, 9 users online (0 registered, 9 guests)
Index | Admin contact |   Forum Time: Sep 17, 2019 - 1:22 pm EDT  |  Hits:28,645,505  (1,505 Today )
RSS Feed