tc_app
Inspect and control 1C application state: read active windows, child objects, errors, dialogs, and limits; capture screenshots; set action timeouts; predefine file-dialog results.
Instructions
Application-level state: active window, child objects, errors, dialogs, limits. Also available: tc_field(action="is_visible"), tc_field(action="is_enabled"), tc_field(action="get_context_menu").
marks a required action parameter; the group schema treats action parameters as optional. Pass action="name" and only that action's parameters. Actions:
clear_file_dialog_result() Clear a previously set file-dialog result. (1C 8.3.25+)
get_active_window() Read the active window: ref/class/title/platform_version, optional form_name/url/home_page/is_main. title is the form caption (null: no form or unreadable); url is empty without a link. form_name is a metadata name, not the form's GUID name; it is only attempted when the window supplies no caption and may remain absent; absence says nothing about the form. Read it explicitly with tc_app(action="get_child_objects") on the window ref. platform_version identifies this connection; unsupported actions report available_since. addressable=false means no element address, not a window type. native=true with recovery=close_window indicates a local preview to close before addressing form elements. active_window_unavailable gives recovery guidance; no_active_work_window requires opening a form with tc_window(action="execute_command"). (1C 8.3.3+)
get_child_objects(ref=null, scope='window') Read one level: parent and children: [...], with class/title and optional name/type/form_name. type is the platform element kind (null if unknown); ManagedForm.form_name is its metadata name. Omitted parent uses the last observed active window, querying it if none was observed. scope=application without a parent lists application windows. Windows/command buttons may include url; windows may include home_page/is_main. Address the parent with ref; children contain ref values. For a whole subtree, pass root_ref to tc_find(action="find_objects"). (1C 8.3.3+)
get_current_error() Get info about the session's last CLIENT error (none → null). error is the main description; details preserves additional text, including nested causes, module locations and stacks. Application messages (e.g. unfilled fields or posting refusal) are read with tc_window(action="get_user_message_texts"); they may include earlier actions. (1C 8.3.3+)
get_max_action_time() Get the max action-execution time in seconds (set via tc_app(action="set_max_action_time"); None if unset).
get_parent(ref*) Get an element's parent in parent: [...]. The server resolves the parent's own address and returns it with the available object metadata. Address the element with ref; objects in parent contain their own ref values. (1C 8.3.24+)
get_performance(clear=False) Get accumulated session performance counters (calls, duration, sent, received). Set clear to also reset them, so the next read measures only what happened after this call. (1C 8.3.6+)
get_screenshot(scale=100, grid=False, region=null) Capture the connected 1C window with popups as an image, without changing focus. Requires a local client on Windows or Linux with X11/XWayland and desktop access. scale: 25..100 percent. Optional region=[x,y,width,height] uses original screenshot pixels; grid labels those coordinates. capture_complete=false means some popups are missing. Screenshots are not recorded in scenarios.
set_file_dialog_result(result=True, filename=null, filter_index=0) Predefine the NEXT file dialog: result=true with filename (or a list for multiple files) selects; false cancels. filter_index is 0-based. Call BEFORE opening; cannot answer an open dialog. Each answer is consumed once. On 8.3.25+, replaces pending answers; clear_file_dialog_result clears unused ones. Older platforms cannot clear them: prepare only the next dialog. (1C 8.3.8+)
set_max_action_time(seconds*) Set the max action-execution time in seconds: how long a result-returning action may take before the call gives up (0 = wait indefinitely). Stored on the client (no network call) and applied to every subsequent command. ref selects the client; otherwise set connection_id when several clients are connected. Use tc_session(action="list_connections"). Success may omit target/connection echoes and shorten window details. Use returned references unchanged in ref; re-find expired elements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| grid | No | ||
| clear | No | ||
| scale | No | ||
| scope | No | ||
| action | Yes | ||
| region | No | ||
| result | No | ||
| seconds | No | ||
| filename | No | ||
| filter_index | No | ||
| connection_id | No |