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

Notification

Icon
Error

Options
Go to last post Go to first unread
JPS  
#1 Posted : Sunday, March 12, 2023 3:37:23 PM(UTC)
JPS

Rank: Member

Reputation:

Groups: Approved
Joined: 12/6/2022(UTC)
Posts: 12

Thanks: 5 times
Hey guys,
Right now my script is executed on every action, that is great! Thanks Rob for That.
What I would love it to execute an external script when a gesture is fired, even if there is no global or app action for it, can it be done?
Rob  
#2 Posted : Monday, March 13, 2023 3:18:24 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 412 time(s) in 352 post(s)
Download this:

https://www.strokesplus.net/files/plugins/ExecuteOnGestureMatch.zip

Extract it, then from the Plug-Ins section of S+, click Add Plug-In and browse to the DLL.

Then in Global Actions > Load/Unload > Load script, put this script:

Code:
// Put in Global Actions > Load/Unload > Load script
function executeOnGesture() {
    
    // Put your script here

    // vv Remove this, just for demo
    StrokesPlus.Console.Log(`Button: 
                            ${ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.Button.ToString()} 
                            - Gesture: ${ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.GestureName}`, 
                            "ExecuteOnGestureMatchWatcher");
    // ^^ Remove this, just for demo
}
ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.ExecuteScript = "executeOnGesture();";
thanks 1 user thanked Rob for this useful post.
JPS on 3/13/2023(UTC)
JPS  
#3 Posted : Monday, March 13, 2023 4:16:52 PM(UTC)
JPS

Rank: Member

Reputation:

Groups: Approved
Joined: 12/6/2022(UTC)
Posts: 12

Thanks: 5 times
Man, this is AWESOME, you are the best, THANK YOU so much for your support, it is Superb!!!!
I'll test it and then I'll send you the results
Rob  
#4 Posted : Monday, March 13, 2023 4:27:12 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 412 time(s) in 352 post(s)
You're welcome!

I should note that it only executes when you draw a gesture with the primary or secondary stroke button is used.
JPS  
#5 Posted : Monday, March 13, 2023 7:14:45 PM(UTC)
JPS

Rank: Member

Reputation:

Groups: Approved
Joined: 12/6/2022(UTC)
Posts: 12

Thanks: 5 times
Rob, I did all the steps, and the plugin is loading, I restarted the app, and all is good, but when the gestures are fired there's no message in the console, I left your code untouched just for testing.
I tried with a lot of gestures BTW
Maybe something is missing on my end?

And a quick one, this code fires when a gesture is used independently if it has an action associated.? because if it IS associated with an action, it's already working with your previous instructions.

first
second

Originally Posted by: Rob Go to Quoted Post
Download this:

https://www.strokesplus.net/files/plugins/ExecuteOnGestureMatch.zip

Extract it, then from the Plug-Ins section of S+, click Add Plug-In and browse to the DLL.

Then in Global Actions > Load/Unload > Load script, put this script:

Code:
// Put in Global Actions > Load/Unload > Load script
function executeOnGesture() {
    
    // Put your script here

    // vv Remove this, just for demo
    StrokesPlus.Console.Log(`Button: 
                            ${ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.Button.ToString()} 
                            - Gesture: ${ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.GestureName}`, 
                            "ExecuteOnGestureMatchWatcher");
    // ^^ Remove this, just for demo
}
ExecuteOnGestureMatch.ExecuteOnGestureMatchWatcher.ExecuteScript = "executeOnGesture();";

Edited by user Monday, March 13, 2023 7:35:15 PM(UTC)  | Reason: Not specified

Rob  
#6 Posted : Monday, March 13, 2023 7:34:59 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 412 time(s) in 352 post(s)
Every. Single. Time. I forget to tell folks to go to Options > Advanced and check the box for Enable Mouse Hook Event Subscription. BigGrin

Quote:
And a quick one, this code fires when a gesture is used independently if it has an action associated.?

Yes, it doesn't care about anything happening in the core S+ logic - just that a stroke button was pressed, a known gesture was drawn, and the stroke button was released.

thanks 1 user thanked Rob for this useful post.
JPS on 3/14/2023(UTC)
JPS  
#7 Posted : Tuesday, March 14, 2023 12:46:04 PM(UTC)
JPS

Rank: Member

Reputation:

Groups: Approved
Joined: 12/6/2022(UTC)
Posts: 12

Thanks: 5 times
So great Rob, thank you again, all is working!!!!

Thanks
Thanks
Thanks
...
...
...
Love

See you soon Rob, great job with this software, so needed, irreplaceable, this and autohotkey are the best!!!

Originally Posted by: Rob Go to Quoted Post
Every. Single. Time. I forget to tell folks to go to Options > Advanced and check the box for Enable Mouse Hook Event Subscription. BigGrin

Quote:
And a quick one, this code fires when a gesture is used independently if it has an action associated.?

Yes, it doesn't care about anything happening in the core S+ logic - just that a stroke button was pressed, a known gesture was drawn, and the stroke button was released.



Larisa  
#8 Posted : Thursday, September 14, 2023 6:28:57 AM(UTC)
Larisa

Rank: Newbie

Reputation:

Groups: Approved
Joined: 9/14/2023(UTC)
Posts: 1
United States
Location: usa

I am trying to run an external javascript function when the page loads and the function takes a variable that I can only pass through the page ...First, we can use the default browser attribute. This involves using the loading attribute, which can be used on and HTML elements. Setting the loading to "lazy" lets the browser know to load the element as it approaches the viewport It allows easy code readability. It is time-efficient as web browsers cache the external js files, which further reduces the page loading time. It enables both web designers and coders to work with
love language test html and js files parallelly and separately, i.e., without facing any code conflictions.To enhance performance, try to keep JavaScript external. The separate code makes it easier for web browsers to cache. However, use inline scripts only when you're making single page websites. Still, it's better to use external code i.e. external JavaScript If you want to run the same JavaScript on several pages in a web site, you should create an external JavaScript file, instead of writing the same script over and over again. Save the script file with a .js extension, and then refer to it using the src attribute in the <script> tag.


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.