Access runtime system/device info and trigger system-level actions from script.
Syntax
System()
Parameters
None
Returns
System
Behavior / side effects
Access runtime system/device info and trigger system-level actions from script.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
No additional limitations documented; follow the parameter and behavior contract above.
Related APIs
None
Fields
Name
Description
devdict
Device capability info (`isEmulator`, `sdk`, `language`, `darkmode`, `touch`, `capture`).
batterydict
Battery info (`percent`, `charging`, `temperature`, `health`).
screendict
Screen info (`width`, `height`, `orientation`, `density`, `dpi`); `orientation` is display rotation in degrees: `0`, `90`, `180`, or `270`.
memorydict
Memory info (`avail`, `total`, `threshold`, `low`).
Methods
20 methods
System.time_ms
Static Method
Get current timestamp in milliseconds.
Syntax
System.time_ms()
Parameters
None
Returns
Number — Epoch milliseconds.
Behavior / side effects
Get current timestamp in milliseconds.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
started = System.time_ms()
wait(100)
print(System.time_ms() - started)
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.app_version())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Get the stable code of the macro variant selected for this run.
Syntax
System.variant()
Parameters
None
Returns
String — Variant code such as `default` or `pro_plus`.
Behavior / side effects
Get the stable code of the macro variant selected for this run.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Branch by the current macro variant
if System.variant() == "pro_plus":
print("Pro Plus")
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Open the launchable activity of an installed Android app.
Syntax
System.open(package_name)
Parameters
Name
Description
package_nameString
Android application package name, for example `com.android.settings`.
Required · Positional or named
No default
Returns
Boolean — `True` when Android accepts a launch intent; `False` when the app is unavailable, has no launchable activity, or cannot be opened.
Behavior / side effects
Open the launchable activity of an installed Android app. CogniTab resolves the standard or Android TV launcher activity from the package name, so the activity class is not required.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Open Android Settings and handle an unavailable target
opened = System.open("com.android.settings")
if not opened:
System.toast("App is unavailable")
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.sdk())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
String — Locale language code (for example `en`, `vi`).
Behavior / side effects
Get current language code.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.language())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.dpi())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
if System.darkmode():
print("Dark mode")
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
System.play_noti()
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Toast text or structured value to display compactly.
Required · Positional or named
No default
Returns
None — No return value.
Behavior / side effects
Show system toast message. Structured values are rendered with the compact DSL display formatter so the toast stays short and readable.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
System.toast("Macro started")
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Optional minimized dock footprint width in pixels.
Optional · Keyword only
Default:None
heightNumber?
Optional minimized dock footprint height in pixels.
Optional · Keyword only
Default:None
alphaNumber?
Optional dock opacity from 0.2 to 1.0.
Optional · Keyword only
Default:None
modeString?
Optional dock presentation. Values: icon or row.
Optional · Keyword only
Default:None
Returns
dict — Applied state with `applied`, `x`, `y`, `width`, `height`, `alpha`, `mode`, and optional `reason`.
Behavior / side effects
Query or adjust the minimized overlay dock. The point uses the same coordinate scale and anchor rules as Point-based click targets; width and height are current-screen pixels.
Execution
Blocking: Conditional
Thread safety: Not guaranteed
Parallel execution: Conditional
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Move, resize, and collapse the minimized dock for this run
System.minimized_dock(Point(24, 120), width=72, height=36, alpha=0.85, mode="icon")
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.back())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.home())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.recent())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.noti())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.lockscreen())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.powerdialog())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.quicksetting())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.
Example
# Query Android or request a documented system action
print(System.screenshot())
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.