Created
November 19, 2015 07:30
-
-
Save hluk/95889230aeea2388dea5 to your computer and use it in GitHub Desktop.
CopyQ - Search All Tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command] | |
Name=Search All Tabs | |
Command=" | |
copyq: | |
// Name for tab for storing matching items. | |
var search_tab_name = \"Search\" | |
// Returns true iff item at index matches regex. | |
function item_matches(item_index, re) | |
{ | |
var text = str(read(j)) | |
return text && re.test(text) | |
} | |
// Ask for search expression. | |
var match = dialog(\"Search\") | |
if (!match) | |
abort() | |
var re = new RegExp(match) | |
// Clear tab with results. | |
try { | |
removeTab(search_tab_name) | |
} catch (e) {} | |
// Search all tabs. | |
var tab_names = tab() | |
for (var i in tab_names) { | |
var tab_name = tab_names[i] | |
tab(tab_name) | |
var item_count = count() | |
// Search all items in tab. | |
for (var j = 0; j < item_count; ++j) { | |
// Add matching item to tab with results. | |
if (item_matches(j, re)) { | |
var item = getItem(j) | |
tab(search_tab_name) | |
setItem(j, item) | |
tab(tab_name) | |
} | |
} | |
} | |
show(search_tab_name)" | |
InMenu=true | |
Icon=\xf002 | |
Shortcut=Ctrl+Shift+F |
tjbiking
commented
Jan 14, 2024
via email
thanks, probably easier for a person in the mindset of the code, at best it
should be added as a merge request to the GitHub repo latest version..
anticipating and will be sure to spread the news if it appears
…On Sun, Jan 14, 2024, 10:22 NA0341 ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
How to include tags in the search?
For that you'd need to specify the according variable in the script & let
the search function include the tags. I guess that'd be line 36
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/hluk/95889230aeea2388dea5#gistcomment-4829976>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANKFOPY4SZPQKZJ63UWTDLYOOPV5BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVAZDQMJVGE3DGONHORZGSZ3HMVZKMY3SMVQXIZI>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Would anyone know how to add the tag search? I can't figure out how to get that information. Thank you.
var tag = str(item[mimeTag])
return text && (re.test(text) || re.test(note) || re.test(tag))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment