Forum Discussion
npaisley
3 years agoStaff
Hi meghaphophalia!
Looks like how you are instantiating your openWindow variable is incorrect.
What we need to do is create a variable that contains just the 'Sys.Process' for your application, then we run the OpenFile method on your object in the variable.
Here is the example from the above documentation you can use to build this out.
function WorkWithFiles()
{
var notepad = Sys.Process("notepad");
var wndNotepad = notepad.Window("Notepad");
// Open a file in Notepad
wndNotepad.MainMenu.Click("File|Open...");
notepad.Window("#32770", "Open").OpenFile("C:\\MyFile.txt");
// Save the file to the desktop
var strDesktop = WshShell.SpecialFolders.Item("Desktop");
wndNotepad.MainMenu.Click("File|Save as...");
notepad.Window("#32770", "Save As").SaveFile(strDesktop + "\\MyFile.txt");
}
Related Content
- 2 years ago
- 8 years ago
- 4 years ago
- 2 years ago
Recent Discussions
- 8 hours ago
- 7 days ago
- 10 days ago