// Sample TBScript using Microsoft JScript // // Connects, opens Notepad, closes, and logs off. // Simply connect using the default data TS.Connect(); // Wait for the desktop to appear, and give // several seconds for the session to get started TS.WaitForTextAndSleep("Recycle Bin", 5000); // Run notepad TS.Start("notepad"); // Wait for notpad to come up TS.WaitForTextAndSleep("Untitled - Notepad", 3000); // Type some text in notepad TS.TypeText("Hello, World!\n\nThis is a sample script!"); // Wait a couple seconds Sleep(3000); // Open the file menu TS.KeyAlt('f'); // Wait for Exit to appear TS.WaitForTextAndSleep("Exit", 750); // Hit 'x' for Exit TS.KeyPress('x'); // Wait for the exit confirmation dialog TS.WaitForTextAndSleep("Do you want to save the changes", 2000); // Hit no, we don't want to save the changes TS.KeyPress('n'); Sleep(3000); // And logoff! TS.Logoff();