public class App extends Object
Modifier and Type | Class and Description |
---|---|
static class |
App.AppEntry |
static class |
App.Type |
Modifier and Type | Field and Description |
---|---|
static String |
lastRunResult |
static int |
lastRunReturnCode |
static String |
lastRunStderr |
static String |
lastRunStdout |
Constructor and Description |
---|
App(int pid) |
App(String name)
creates an instance for an app with this name
(nothing done yet)
|
Modifier and Type | Method and Description |
---|---|
int |
close()
tries to close the app defined by this App instance
|
static int |
close(String appName)
tries to identify a running app with the given name
and then tries to close it
|
App |
focus()
tries to make it the foreground application
bringing its topmost window to front
|
App |
focus(int num)
tries to make it the foreground application
bringing its window with the given number to front
|
static App |
focus(String appName)
tries to identify a running app with name and
if not running tries to open it
and tries to make it the foreground application
bringing its topmost window to front
|
static App |
focus(String appName,
int num)
tries to identify a running app with name and
if not running tries to open it
and tries to make it the foreground application
bringing its window with the given number to front
|
static Region |
focusedWindow()
evaluates the region currently occupied by the systemwide frontmost window
(usually the one that has focus for mouse and keyboard actions)
|
static void |
getApps() |
static void |
getApps(String name) |
static String |
getClipboard()
evaluates the current textual content of the system clipboard
|
String |
getName() |
Integer |
getPID() |
String |
getWindow() |
boolean |
hasWindow() |
boolean |
isRunning() |
boolean |
isRunning(int maxTime) |
boolean |
isValid() |
App.AppEntry |
makeAppEntry() |
App |
open()
tries to open the app defined by this App instance
do not wait for the app to get running |
App |
open(int waitTime)
tries to open the app defined by this App instance
|
static App |
open(String appName)
creates an instance for an app with this name and tries to open it
|
App |
openAndWait(int waitTime) |
static boolean |
openLink(String url) |
static void |
pause(float time) |
static void |
pause(int time) |
static int |
run(String cmd)
the given text is parsed into a String[] suitable for issuing a Runtime.getRuntime().exec(args).
|
static void |
setClipboard(String text)
sets the current textual content of the system clipboard to the given text
|
App |
setUsing(String options) |
static Region |
start(App.Type appType) |
String |
toString() |
String |
toStringShort() |
Region |
waitForWindow() |
Region |
waitForWindow(int seconds) |
Region |
window()
evaluates the region currently occupied
by the topmost window of this App instance.
|
Region |
window(int winNum)
evaluates the region currently occupied
by the window with the given number of this App instance.
|
public static int lastRunReturnCode
public static String lastRunStdout
public static String lastRunStderr
public static String lastRunResult
public App(String name)
name
- namepublic App(int pid)
public Region waitForWindow()
public Region waitForWindow(int seconds)
public static boolean openLink(String url)
public static void pause(int time)
public static void pause(float time)
public App.AppEntry makeAppEntry()
public static void getApps(String name)
public static void getApps()
public Integer getPID()
public String getName()
public String getWindow()
public boolean isValid()
public boolean isRunning()
public boolean isRunning(int maxTime)
public boolean hasWindow()
public String toStringShort()
public static App open(String appName)
appName
- namepublic App open()
public App open(int waitTime)
public App openAndWait(int waitTime)
public static int close(String appName)
appName
- namepublic int close()
public static App focus(String appName)
appName
- namepublic static App focus(String appName, int num)
appName
- namenum
- windowpublic App focus()
public App focus(int num)
num
- windowpublic Region window()
public Region window(int winNum)
winNum
- windowpublic static Region focusedWindow()
public static int run(String cmd)
cmd
- the command to run starting with an executable itempublic static String getClipboard()
public static void setClipboard(String text)
text
- text