Forum Discussion
rraghvani
Champion Level 3
Oops, I've just noticed you are using Sys.WaitProcess() and not Sys.Process()
Here's an example,
function Notepad()
{
// Assuming Notepad is opened.
var process = Sys.Process("notepad");
// Enter text
process.Window("Notepad", "Untitled - Notepad", 1).Window("Edit", "", 1).SetText("Smartbear"); // Comment out line
// Close application
Sys.Process("notepad").Close();
// Respond to save dialog
if (Sys.WaitProcess("notepad", 5000).Exists)
{
// Click 'don't save' button
process.Window("#32770", "Notepad", 1).UIAObject("Notepad").Window("CtrlNotifySink", "", 8).Window("Button", "Do&n't Save", 1).Click();
}
}
1. Launch Notepad, and run the script.
2. Comment out the SetText() line.
3. Launch Notepad again, and run the script.
The script deals with the 'Do you want to save changes to Untitled?' dialog appearing, as well it not appearing.
zoey
2 years agoOccasional Contributor
Hi ,
Thanks again , but I would have a question do you mean my issue was when I used Sys.WaitProcess() and not Sys.Process() ?
so do you mean issue will solve when close the application not using ( File->Exit ) and click on "No" button in close popup and check process if closed or not as before , but it will use Close method only to close it and check close popup , right ?
look at for my bellow code :
Related Content
Recent Discussions
- 11 hours ago
- 7 days ago
- 10 days ago