nick
March 1, 2023, 6:23pm
#1
For @kxxc :
// #popclip
// { name: 2x Search, lang: js }
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://example1.com/?q=" + query);
popclip.openUrl("https://example2.com/?q=" + query);
(The above block is an extension snippet - select it then click “Install Extension” in PopClip.)
To search more sites, just add more lines.
2 Likes
kxxc
March 1, 2023, 7:06pm
#2
yees! thank you
but looks like these lines no longer working on js code, haha…
icon: iconify:tabler:square-rounded-number-4
requirements: [text, “!urls”]
after: copy-selection
nick
March 1, 2023, 7:08pm
#3
Post the whole thing for me so I can take a look.
BTW, when posting the forum you can write ``` on the line before and after the code to format it as a code block
kxxc
March 1, 2023, 7:18pm
#4
Gave me a shaking X feedback
// { name: test, lang: js }
icon: iconify:tabler:square-rounded-number-4
requirements: [text, "!urls"]
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://www.apple.com/tw/search/" + query);
popclip.openUrl("https://www.youtube.com/results?search_query=" + query);
after: copy-selection
nick
March 1, 2023, 7:25pm
#5
Nice job with the ```
So the extension has two parts, the settings and the code, which need to be kept separate.
The extension settings go in the in the top part, with //
before each line, like this:
// #popclip
// name: test
// lang: js
// icon: iconify:tabler:square-rounded-number-4
// requirements: [text, "!urls"]
// after: copy-selection
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://www.apple.com/tw/search/" + query);
popclip.openUrl("https://www.youtube.com/results?search_query=" + query);
1 Like
kxxc
March 1, 2023, 7:39pm
#6
I’m alive again! thank u vm!
so many ways in PopClip so much mystery.
every Mac user should use it
1 Like