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

Notification

Icon
Error

Options
Go to last post Go to first unread
2014218866  
#1 Posted : Saturday, August 28, 2021 11:08:05 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Hello,Rob

I want to know if S+ can perform different functions on different web pages in Google Chrome. For example, in a youtube page, you can increase or decrease the volume by scrolling the mouse wheel, but in other URLs you can perform the function of zooming the page. It may not be possible, but it is very practical.

Looking forward to your reply
randomConstant  
#2 Posted : Monday, August 30, 2021 6:31:33 PM(UTC)
randomConstant

Rank: Advanced Member

Reputation:

Groups: Translators, Approved
Joined: 7/17/2021(UTC)
Posts: 135

Thanks: 35 times
Was thanked: 18 time(s) in 15 post(s)
One way of doing it might be:
  1. Focusing on address bar (with Ctrl+E, Ctrl+X or whatever shortcut you may have)
    Copying its URL (with Ctrl+C)
    Storing it in a variable in script
    Comparing it with "youtube" or any other domain (using regex for example)
    And then taking different actions using switch or if-else statements

Good luck : )
randomConstant  
#3 Posted : Wednesday, November 24, 2021 1:17:37 PM(UTC)
randomConstant

Rank: Advanced Member

Reputation:

Groups: Translators, Approved
Joined: 7/17/2021(UTC)
Posts: 135

Thanks: 35 times
Was thanked: 18 time(s) in 15 post(s)
Update

Check out the Title function from SystemWindow section of script help in S+. It returns the title(as a string) of active window, such as 'C Drive', 'Youtube - Chrome', 'SomeVideoTitle - Youtube - Chrome' and so on.

Code:
action.Window.Title


You can then use regex to look for lets say 'YouTube' in the returned title string and choose actions of your choice. Those actions will only execute if Title contains YouTube in them. So mostly when you're on youtube.com and maybe when you're on a site with title like 'YouTube disables dislike feature - CNN - Chrome', which can further be eliminated if you search for 'YouTube - Chrome' instead of just they keyword 'YouTube'.

I haven't tested it, just tested the .title function for its behavior but it should work.

Hope this helps.
thanks 1 user thanked randomConstant for this useful post.
2014218866 on 11/26/2021(UTC)
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.