Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2021 13:57
What would you like to do?
Quicksilver action to run a regex on input text
using terms from application "Quicksilver"
on get direct types
return {"NSStringPboardType"}
end get direct types
on get indirect types
return {"NSStringPboardType"}
end get indirect types
-- thirdPaneStuff is optional
on process text textToSearch with regex
-- Fix newlines
set regexResult to do shell script "/opt/homebrew/bin/perl -pe 's/\\R/
/g' <<< " & quoted form of textToSearch & " | /opt/homebrew/bin/perl -pe " & quoted form of regex
tell application "Quicksilver" to set selection to regexResult
on error a number b
display dialog a with title "error with your QS action script"
end try
end process text
on get argument count
return 2
end get argument count
end using terms from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment