Currently the "enable profile switching for the following windows" only allows for hard-coded input. I think it would be
fantastic if this field accepted tokens. This would provide even more contextual control and expanded functionality to whichever users are interested in it.
I've already discussed some of the drawbacks of having profile switching handled via window title only and made a case for profile switching via window process name
here. But if the profile switching field could accept tokens it would be possible to perform switching via process name via {EXP}.
Here's an example. Under certain circumstances it is possible for two applications to have the same window title, potentially causing undesirable profile switching if both app windows are in use. Now say I have a profile called "Profile1" that I want to switch to when I select the window titled "MyWindow" that is associated with the application "MyApp." I can then just use this in the "enable profile switching" field:
{EXP: IIF('{ACTIVEWINDOWPROCESSNAME}' = 'MyApp', 'MyWindow', 'no action')}
...so only activating the window titled MyWindow related to the process MyApp will trigger the expression to output "MyWindow" text into the switching field, which would then trigger a switch to Profile1. And other apps with window title MyWindow wouldn't trigger the profile switch. Though this would require the tokens to be reevaluated every time a new window is activated. This is just one possible use for this kind of functionality.
Gary do you think it would be feasible to have the "enable profile switching" field accept tokens?