开发者

FoneMonkey able to input text to a UITextView?

开发者 https://www.devze.com 2023-03-18 08:48 出处:网络
So far found ways to get FoneMonkey to behave for most of what I\'m scripting, however, when trying to enter text into a UITextView, it does not capture it during开发者_如何学Go recording. If I manual

So far found ways to get FoneMonkey to behave for most of what I'm scripting, however, when trying to enter text into a UITextView, it does not capture it during开发者_如何学Go recording. If I manually add a InputText command for the UITextView, it does not actually input the text.

I'm using the latest version (5.0b).

Unless I missed them, there are no specific examples in the doc showing a command for entering text in a UITextView (there are for UITextField, and that does work for me).


You can input text with the built-in FMCommandInputText command, like so:

NSMutableArray *array = [NSMutableArray array];

[array addObject:[FMCommandEvent command:FMCommandTouch className:UITextView
                                    monkeyID:TEXTVIEW_MONKEYID args:nil]];

[array addObject:[FMCommandEvent command:FMCommandInputText className:UITextView
                                monkeyID:TEXTVIEW_MONKEYID 
                                    args:[NSArray arrayWithObjects:yourText, nil]]];

result = [FoneMonkeyAPI playCommands:array];

Does this work?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号