RandmTask Posted July 26, 2022 Share Posted July 26, 2022 Hopefully a simple question, I have a find and replace that removes any '>>>' or empty spaces ' ' from the selected text and pastes it. https://www.dropbox.com/s/doc1vj7rwugegtd/Strip >.alfredworkflow?dl=1 I want to have a fallback so if there is no selected text it will process text on the clipboard instead. Any idea how I can go about that? Thanks Link to comment
vitor Posted July 26, 2022 Share Posted July 26, 2022 Connect a Fallback Search Trigger to an Argument and Variables Utility with {clipboard} as the Argument. That then connects to your Replace Utility. Link to comment
RandmTask Posted July 27, 2022 Author Share Posted July 27, 2022 Thanks Vitor, I seem to have misused the term 'fallback'. I don't actually want fallback search results. What I want is: If text is selected → Use that If there is no text selected -> Use clipboard (if there is any text) Sorry for the confusion! Link to comment
vitor Posted July 27, 2022 Share Posted July 27, 2022 Add a Conditional Utility. Leave it with the default of if {query} is equal to which translates to “if input is equal to <empty>”. Then connect the top output to an Argument and Variables Utility with {clipboard} as the argument. Like so. Keep in mind that when nothing is selected, it’ll still work but you’ll hear a sound. That’s unavoidable, as it’s coming from macOS erroring when you can’t copy the selection. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now