StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
gsom9000  
#1 Posted : Saturday, January 16, 2021 2:23:46 PM(UTC)
gsom9000

Rank: Newbie

Reputation:

Groups: Approved
Joined: 9/18/2018(UTC)
Posts: 3

Hi. Can someone write a script to search selected text? I dont know anything about scripts, but i believe its possible. For example, here is a search string for youtube:
Quote:
http://www.youtube.com/results?search_query=text

So what i want - is when i select some text, then draw U stroke and new browser tab opens with search string with text replaced with my text.
Also when new tab with search results on youtube is closed, the text remain selected and for example it is possible to search the same text on google, with stroke "G" and line:
Quote:
https://www.google.com/search?q=text


Please if it is not hard for you, create such useful script
Rob  
#2 Posted : Monday, January 18, 2021 8:50:42 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 865
United States
Location: Tampa, FL

Thanks: 20 times
Was thanked: 222 time(s) in 193 post(s)
Sorry, I somehow missed your post. These both work for me:
Code:
//YouTube
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_C]);
sp.Sleep(50);
sp.Run(`http://www.youtube.com/results?search_query=${encodeURI(clip.GetText())}`);

//Google
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_C]);
sp.Sleep(50);
sp.Run(`https://www.google.com/search?q=${encodeURI(clip.GetText())}`);
thanks 1 user thanked Rob for this useful post.
Junt62 on 1/20/2021(UTC)
Junt62  
#3 Posted : Wednesday, January 20, 2021 4:50:33 PM(UTC)
Junt62

Rank: Newbie

Reputation:

Groups: Approved
Joined: 1/5/2021(UTC)
Posts: 2

Thanks: 1 times
I just like that. And that's what i want SP to do. Thanks for Rob.
It woooooooork on my computer now, Thank you so much~~~
gsom9000  
#4 Posted : Wednesday, January 20, 2021 9:11:49 PM(UTC)
gsom9000

Rank: Newbie

Reputation:

Groups: Approved
Joined: 9/18/2018(UTC)
Posts: 3

Originally Posted by: Rob Go to Quoted Post
Sorry, I somehow missed your post. These both work for me:


Hey, don't be sorry, and thank you so much for this! It is something pleasant to search anything with just gesture, loved it from the first try. Btw, where should i ask such questions about scripts - in this section or in "Scripts"?
Rob  
#5 Posted : Wednesday, January 20, 2021 9:51:08 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 865
United States
Location: Tampa, FL

Thanks: 20 times
Was thanked: 222 time(s) in 193 post(s)
Quote:
where should i ask such questions about scripts

It doesn't really matter, I just need to have multiple forum categories so it doesn't look empty on the main page Cool
lyscop  
#6 Posted : Friday, February 19, 2021 9:07:17 AM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 4/23/2020(UTC)
Posts: 56
China

Thanks: 11 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Rob Go to Quoted Post
Quote:
where should i ask such questions about scripts

It doesn't really matter, I just need to have multiple forum categories so it doesn't look empty on the main page Cool


Hi, is there a way to judge whether is there a selection context in the globe windows?

Like window.getSelection().toString().trim() by Javascript in a webpage.
Rob  
#7 Posted : Friday, February 19, 2021 10:12:30 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 865
United States
Location: Tampa, FL

Thanks: 20 times
Was thanked: 222 time(s) in 193 post(s)
Not really (there are a few exceptions) - for most applications, an application cannot access data inside another application. Which is why we need to use other allowed methods, like copying to the clipboard, then examining.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.