Quote Originally Posted by 'olipcs',index.php?page=Thread&postID=138596#post1 38596
Code:
<command SendAssistToSpecificWindow>
	<SendPC Local>
     	<If ActiveWinIs %3%>...
Unfortunately you can't use If-Else-EndIf in commands. Here's why. Commands can be loaded on a remote PC. In other words, you might press the hotkey on one PC and that PC sends a message to a second PC saying, "execute this command." The first PC knows only the name of the command. The instructions for the command exist only on the remote PC.

"IfActiveWinIs" applies to the active window on the local PC -- the one where you pressed the trigger. When the command executes on the remote PC, it sees the statement "<If ActiveWinIs ...>." In order to evalute that statement, the remote command has to know which window is active on a different PC. How can it know? Either --

(a) It sends a query to the local PC asking for the name of the active window, or

(b) Every single time the local PC sends instructions to a remote PC, it has to include the name of the local window.

The second option gets ruled out because it doesn't work for "IfWinExists". So I would have to implement (a). There were two drawbacks to this:

1. It would be slightly slow (round trip ping times are about 1.5 milliseconds on my network, which I'm guessing is typical).

2. It would take me probably a day's work to implement it and maybe more to debug, and by the time I implemented If-Else-EndIf I had decided to limit my time on the program because I want to get it finished and move on to the next one.

Another option -- this is occuring to me now for the first time -- is make If-Else-Endif apply to whichever PC the definition was loaded on instead of the PC where you press the trigger. This would make the implementation easier for me, but it might be confusing for users.