• getAppInfo subcommand ?option ?value??
Return information about Alpha or other applications. The syntax can
take different forms (explained below):
- getAppInfo commands
- getAppInfo current -[bnp]
- getAppInfo darkMode
- getAppInfo host
- getAppInfo identifier ?path?
- getAppInfo mainWindow -[kn]
- getAppInfo name -[bps] value
- getAppInfo osversion
- getAppInfo path -[bnps] value
- getAppInfo pid
- getAppInfo processes
- getAppInfo running -[b] value
- getAppInfo url -[bnps] value
- getAppInfo version
- getAppInfo versionName
The options have the following meaning:
Option | Description |
-b | bundle identifier |
-k | kind |
-n | name |
-p | process identifier |
-s | application signature |
The subcommands have the following meaning:
- The subcommands
pid,
version,
versionName
return the process identifier (pid), version number and
version name of Alpha itself.
- The subcommand identifier returns
the bundle identifier of the application specified by the path
argument. If path is not specified, it returns the bundle
identifier of Alpha itself.
- The subcommand osversion
returns the version number of the OS X system Alpha is running on.
- The subcommand darkMode returns a
boolean value indicating whether dark mode is currently enabled. Dark mode is
available on Mac OS X 10.14 or greater: on prior versions, this command
will always return 0.
- The subcommand host
returns the host name of the computer.
- The subcommand commands returns
the list of all the core Tcl commands defined by Alpha.
- The processes subcommand returns a
list of sublists corresponding to the currently running processes. Each
sublist contains four items: the localized name, the process identifier
(pid), the bundle identifier and the full path.
- The running subcommand returns a
list of process identifiers (pid) for all currently running
applications with the specified bundle identifier. If none is running, the
command returns an empty list.
- The subcommands name,
path,
url take
as an argument an application designated by its bundle identifier (option
-b), its name (option -n), its process identifier if it is
a running process (option -p) or its signature (option -s)
and return the required information. The -s option is provided as a
convenience for compatibility reasons, but the use of signatures is
deprecated and should be avoided in favor of the -b option.
- The subcommand mainWindow returns
information about Alpha's main window :
- with the option -k, it
indicates the main window's kind: the returned value is "alphadoc"
if it is a document window or "viewroot" if it is a root window
(created with the [view root] command).
- with the option -n, it
returns the name of the main window if it is a document window (kind alphadoc) or its token if it is a root window (kind "viewroot").
If there is no main window (or if the application is not active or is
hidden), the command returns an empty string.