ERROR: “Window cannot be focused” during a ‘Focus Window’ step

Applies To: AutoMate 6, AutoMate 5
Published: 10/26/06 , modified September 27, 2007

Symptoms / Reasons:
When a task that includes a 'Focus Window' or 'Wait for Window' action is launched while the Task Administrator window is open, AutoMate may fail to focus on the specified window and issue error "The system cannot find the file specified" or "Window cannot be focused."

The "Windows Foreground Timeout" feature of the Windows operating systems prevent other applications from focusing or changing the order of windows on a system without direct user interaction unless the application has been accessed within a set period of time. This can prevent AutoMate from properly focusing specific windows when using the 'Focus Window' action (the error may be confusing because it should actually read: "The system cannot find the window specified").

Solution:
To solve this problem, from the 'Task Administrator,' navigate to 'System' -> 'Options' -> 'System' tab and check the option "Disable Windows Foreground timeout." This will disable the Windows Foreground Timeout feature and the task will correctly focus the specified window.

Optionally, a free Microsoft program called TweakUI has the option to disable Windows Foreground Timeout. You can find more details as well as download the product here:

Windows XP Power Toys