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,343
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 415 time(s) in 354 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,343
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 415 time(s) in 354 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,343
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 415 time(s) in 354 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.



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.