Skip to main content

Input-Text-after-Intelligent-Recognition

Command Description

Input text after intelligent recognition

Command Prototype

UiDetection.InputText(objUiElement,sText,bEmptyField,iInterval,iTimeout,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTrueexpression{}Select the recognized target of Computer Vision and the feature values of the anchor element
sTextTruestring""Write text into the specified target element
bEmptyFieldTruebooleanTrueWhether to clear the input box before writing the text
iIntervalTruenumber200The interval between two inputs. If the interval is too small, words may be lost. The suggested default value is 200 ms
iTimeoutTruenumber30000Specify the amount of time (in milliseconds) that wait for the event to run before selectorNotFoundException to trigger an error (in milliseconds) The default value is 10,000 ms (10 seconds)
bContinueOnErrorNonebooleanNoneSpecify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value
iDelayAfterNonenumber300Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber200The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds
sKeyModifiersNoneset[]Keyboard keys used while a mouse action is triggered: Alt, Ctrl, Shift, Win
bSetForegroundNonebooleanTrueWhether to activate the target window before executing
sSimulateNoneenum"message"Available operation types are: Simulated Operation (simulate), System Message(message). Default: System Message(message)

Demo

TracePrint("--------------------------Enter text after intelligent recognition---------------- -------------") 
//-------------------------------------------------------------------------------
//[Remarks] Enter text after intelligent recognition. (This command must be used together with the intelligent recognition screen range)
//Input parameter 1:
// objUiElement--Identifies the target. Note: The eigenvalues ​​of the selected intelligently recognized target element and anchor element
// sText--write text. Note: Write text in the specified target element
// bEmptyField--Empty the original content. Note: Whether to clear the input box before writing text
// iInterval--Type the interval (milliseconds). Note: The interval between two inputs, if the interval is too small, words may be lost, it is recommended to default to 200 milliseconds
// iTimeOut--timeout time (milliseconds). Note: The amount of time, in milliseconds, to wait for the command to retry the run before the lookup target throws an exception. Default 30000 (30 seconds)
// optionArgs--Optional parameters. Note: This parameter is a number of optional parameters, including error continue execution, delay after execution, delay before execution, activation window, cursor position, abscissa offset, ordinate offset, auxiliary keys, operation type
//out parameters:
// None
//命令原型:UiDetection.InputText(objUiElement,sText,bEmptyField,iInterval,iTimeout,optionArgs)
#icon("@res:95f63900-7f22-11ec-ab08-1d7b5faf0fee.png")
UiDetection.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"Click - 飞书云文档 - Google Chrome","app":"chrome"}],"cv_engine_version":1,"cv_region":{"x":0,"y":0,"width":0,"height":0},"cv_descriptor":{"confidence":0.800000011920929,"cv_handle":"\"2b3223b0-7f20-11ec-ab08-1d7b5faf0fee\"","match_version":1,"target":{"cls_type":100,"height":17,"text":"UiDetection.C1ick(objUiElement,iButton,iType,iTimeout,optionArgs","width":529,"x":643,"y":544}}},"测试",true,200,30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sKeyModifiers":[],"bSetForeground":true,"sSimulate":"message"})