I was able to dig into Brett’s Instant Search script for SearchLink and create an extension that copies much of the functionality. Instead of opening the url, I just add it to the clipboard and paste using Launchbar’s after param.
Wow amazing, after installing SearchLink.workflow to ~/System/Library I got it up and running. Quite a handy workflow and having it in PopClip is a bit magic.
I noticed it was only searching the first word of the selection - needs the input quoting like this \"{popclip text}\" (I’ve edited your source)
I wanted to include these in the original but I took too long and can’t edit. I’ll have a video on this soon but I wanted again to share here first. Here are the three Searchlink PopClip snippets (You still need search link installed)…
# popclip SearchLink + Multi Actions
name: SearchLink Copy
requirements: [text]
icon: search c
applescript: do shell script "automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|awk '/http/{gsub(/^[ \t]*\"|\"[ \t]*$/,\"\"); print}'|pbcopy"
# popclip SearchLink on Selected Text and Paste
name: SearchLink Paste
requirements: [text, paste]
icon: search p
applescript: do shell script "automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|awk '/http/{gsub(/^[ \t]*\"|\"[ \t]*$/,\"\"); print}'|pbcopy"
after: paste
# popclip Seachlink Open Selected Text in default browser
name: Searchlink Open
requirements: [text]
icon: search o
applescript: do shell script "open $(automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow | grep -o 'https[^ ]*')"
Copy Runs Searchlink and adds to clipboard to be pasted elsewhere
Paste Is the same as the first but will replace the selected text with the results (good for overwriting in a blog post) - The original concept
Open Will open the results of the searchlink wherever. (Basically I’m feeling lucky)
Hi - just had a quick question. When i install the “Open” popclip and use it, the resulting websearch returns an error. It looks like its attaching extra characters to the end. Here’s an example: https://www.amazon.com/)"
Any idea of how to fix this? It’s happening whenever i use that “open” popclip.