Skip to content
Prev 384639 / 398525 Next

Opening Another Application in R Then Hangs

For posterity, Abby's suggestion is spot on.

The small program below demonstrates the functionality.  May need to change numbers in mouse.move depending on where your copy of Notepad opens up.  You can find the position of your mouse on the screen using mouse.get_cursor()

Thanks to all, but especially to Abby.

--JJS


library(KeyboardSimulator)
setwd("C:/Users/JSparks/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Accessories")
shell ("Notepad", wait=FALSE)
Sys.sleep(3)
mouse.move(362,300)
mouse.click()
keybd.type_string("Hello world!")
Message-ID: <DM5PR13MB1161852ACBB590CF18752B38FA690@DM5PR13MB1161.namprd13.prod.outlook.com>
In-Reply-To: <CAB8pepwW4q5WQ9q9H3n8G-fbogd2AJgXQk3YsdYhs-eF7T_JBg@mail.gmail.com>