This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Specify 'Except' in Owner Class Definition
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ziongates

1 Posts

Posted - 02/20/2013 :  07:57:24  Show Profile
Greetings Gurus,

Is it Possible to set up an action to run on all windows 'Except' a specified class, filename, etc?

If it's not implemented It would be very useful once implemented.

Rob

USA
2615 Posts

Posted - 02/20/2013 :  09:48:06  Show Profile  Visit Rob's Homepage
Sure, there are two ways you can do this.


1. Exclude by using an application

Create an application in S+ and use the Owner/Parent/Control Class Name Pattern or File Name Pattern field (whichever applies) and enter a regular expression pattern to exclude the class/file.

For example, this would execute for any window which doesn't have an owner class of "Notepad" (the actual owner class for Notepad):

Owner Class Name Pattern: ^(?!Notepad).*$

Or to exclude based on the EXE name:

File Name Pattern: ^(?!notepad.exe).*$

So if you executed an action over any window except Notepad, the action would fire. Keep in mind that if you draw over Notepad, that S+ will check the Global Actions to see if you have an action which matches (gesture/modifiers) and fire it.


2. Exclude within a Global Action

In the Global Action, check for the class/file name and if it's a certain value, don't run the script:

By Owner Class Name:
if acGetClassName(acGetOwnerWindowByPoint(gsx,gsy)) ~= "Notepad" then
	acActivateWindow(nil, gsx, gsy, 0)
	acMaximizeOrRestoreWindow(nil,gsx, gsy)
end 

Or by File Name:
if acGetExecutableName(acGetOwnerWindowByPoint(gsx,gsy)) ~= "notepad.exe" then
	acActivateWindow(nil, gsx, gsy, 0)
	acMaximizeOrRestoreWindow(nil,gsx, gsy)
end 
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000