1
+ <!doctype html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > Dialogs | Auto.js 3.0.0 文档</ title >
6
+ < link rel ="stylesheet " href ="https://fonts.googleapis.com/css?family=Lato:400,700,400italic ">
7
+ < link rel ="stylesheet " href ="assets/style.css ">
8
+ < link rel ="stylesheet " href ="assets/sh.css ">
9
+ < link rel ="canonical " href ="https://nodejs.org/api/dialogs.html ">
10
+ </ head >
11
+ < body class ="alt apidoc " id ="api-section-dialogs ">
12
+ < div id ="content " class ="clearfix ">
13
+ < div id ="column2 " class ="interior ">
14
+ < div id ="intro " class ="interior ">
15
+ < a href ="/ " title ="返回首页 ">
16
+ Auto.js
17
+ </ a >
18
+ </ div >
19
+ < ul >
20
+ < li > < a class ="nav-documentation " href ="documentation.html "> 关于本文档</ a > </ li >
21
+ < li > < a class ="nav-synopsis " href ="synopsis.html "> 如何阅读本文档</ a > </ li >
22
+ </ ul >
23
+ < div class ="line "> </ div >
24
+
25
+ < ul >
26
+ < li > < a class ="nav-overview " href ="overview.html "> Overview - 综述</ a > </ li >
27
+ < li > < a class ="nav-qa " href ="qa.html "> Q&A - 常见问题</ a > </ li >
28
+ < li > < a class ="nav-globals " href ="globals.html "> Globals - 一般全局函数</ a > </ li >
29
+ < li > < a class ="nav-widgets-based-automation " href ="widgets-based-automation.html "> WidgetsBasedAutomation - 基于控件的触摸模拟</ a > </ li >
30
+ < li > < a class ="nav-coordinates-based-automation " href ="coordinates-based-automation.html "> CoordinatesBasedAutomation - 基于坐标的触摸模拟</ a > </ li >
31
+ < li > < a class ="nav-images " href ="images.html "> Images - 图片与图色处理</ a > </ li >
32
+ < li > < a class ="nav-console " href ="console.html "> Console - 控制台</ a > </ li >
33
+ < li > < a class ="nav-events " href ="events.html "> Events - 事件与监听</ a > </ li >
34
+ < li > < a class ="nav-timers " href ="timers.html "> Timers - 定时器</ a > </ li >
35
+ < li > < a class ="nav-shell " href ="shell.html "> Shell - Shell命令</ a > </ li >
36
+ < li > < a class ="nav-ui " href ="ui.html "> UI - 用户界面</ a > </ li >
37
+ < li > < a class ="nav-files " href ="files.html "> Files - 文件系统</ a > </ li >
38
+ < li > < a class ="nav-dialogs active " href ="dialogs.html "> Dialogs - 对话框</ a > </ li >
39
+ < li > < a class ="nav-http " href ="http.html "> Http - HTTP</ a > </ li >
40
+ < li > < a class ="nav-app " href ="app.html "> App - 应用</ a > </ li >
41
+ < li > < a class ="nav-engines " href ="engines.html "> Engines - 脚本引擎</ a > </ li >
42
+ < li > < a class ="nav-modules " href ="modules.html "> Modules - 模块</ a > </ li >
43
+ < li > < a class ="nav-work-with-java " href ="work-with-java.html "> Work with Java - 调用Java API</ a > </ li >
44
+ </ ul >
45
+ < div class ="line "> </ div >
46
+
47
+ < ul >
48
+ < li > < a class ="nav-https-github-com-hyb1996-NoRootScriptDroid " href ="https://github.com/hyb1996/NoRootScriptDroid "> GitHub项目 & Issue提交</ a > </ li >
49
+ < li > < a class ="nav-http-autojs-org " href ="http://autojs.org "> Auto.js交流社区</ a > </ li >
50
+ </ ul >
51
+
52
+ </ div >
53
+
54
+ < div id ="column1 " data-id ="dialogs " class ="interior ">
55
+ < header >
56
+ < h1 > Auto.js 3.0.0 文档</ h1 >
57
+ < div id ="gtoc ">
58
+ < p >
59
+ < a href ="index.html " name ="toc "> 索引</ a > |
60
+ < a href ="all.html "> 查看全部</ a >
61
+ </ p >
62
+ </ div >
63
+ < hr >
64
+ </ header >
65
+
66
+ < div id ="toc ">
67
+ < h2 > 目录</ h2 >
68
+ < ul >
69
+ < li > < span class ="stability_2 "> < a href ="#dialogs_dialogs "> Dialogs</ a > </ span > < ul >
70
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_rawinput_title_default "> dialogs.rawInput(title[, default])</ a > </ span > </ li >
71
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_input_title_default "> dialogs.input(title[, default])</ a > </ span > </ li >
72
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_prompt_title_default "> dialogs.prompt(title[, default])</ a > </ span > </ li >
73
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_alert_title_content "> dialogs.alert(title[, content])</ a > </ span > </ li >
74
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_confirm_title_content "> dialogs.confirm(title[, content])</ a > </ span > </ li >
75
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_select_title_items "> dialogs.select(title, items)</ a > </ span > </ li >
76
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_singlechoice_title_items_index "> dialogs.singleChoice(title, items[, index])</ a > </ span > </ li >
77
+ < li > < span class ="stability_undefined "> < a href ="#dialogs_dialogs_multichoice_title_items_indexes "> dialogs.multiChoice(title, items[, indexes])</ a > </ span > </ li >
78
+ </ ul >
79
+ </ li >
80
+ </ ul >
81
+
82
+ </ div >
83
+
84
+ < div id ="apicontent ">
85
+ < h1 > Dialogs< span > < a class ="mark " href ="#dialogs_dialogs " id ="dialogs_dialogs "> #</ a > </ span > </ h1 >
86
+ < div class ="api_stability api_stability_2 "> < a href ="documentation.html#documentation_stability_index "> Stability: 2</ a > - Stable</ div > < p > dialogs 模块允许用户通过对话框与脚本进行交互。</ p >
87
+ < h2 > dialogs.rawInput(title[, default])< span > < a class ="mark " href ="#dialogs_dialogs_rawinput_title_default " id ="dialogs_dialogs_rawinput_title_default "> #</ a > </ span > </ h2 >
88
+ < div class ="signature "> < ul >
89
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
90
+ < li > < code > default</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 可选,对话框内输入框的初始内容。默认为 < code > ""</ code > 。</ li >
91
+ </ ul >
92
+ </ div > < p > 显示一个包含输入框的对话框。如果指定了 < code > default</ code > ,那么对话框显示时输入框的内容就为该值。</ p >
93
+ < p > 该函数也可通过 < code > rawInput(title[, default])</ code > 、 < code > prompt(title[, default])</ code > 或者 < code > dialogs.prompt(title[, default])</ code > 来调用。调用时脚本将阻塞直至对话框被关闭。如果用户输入内容并点击确定,函数将返回输入的内容;否则返回 < code > null</ code > 。</ p >
94
+ < h2 > dialogs.input(title[, default])< span > < a class ="mark " href ="#dialogs_dialogs_input_title_default " id ="dialogs_dialogs_input_title_default "> #</ a > </ span > </ h2 >
95
+ < p > 等效于 < code > eval(dialogs.rawInput(title, default))</ code > </ p >
96
+ < h2 > dialogs.prompt(title[, default])< span > < a class ="mark " href ="#dialogs_dialogs_prompt_title_default " id ="dialogs_dialogs_prompt_title_default "> #</ a > </ span > </ h2 >
97
+ < p > 见 dialogs.rawInput</ p >
98
+ < h2 > dialogs.alert(title[, content])< span > < a class ="mark " href ="#dialogs_dialogs_alert_title_content " id ="dialogs_dialogs_alert_title_content "> #</ a > </ span > </ h2 >
99
+ < div class ="signature "> < ul >
100
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
101
+ < li > < code > content</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 可选,对话框的内容。默认为空。</ li >
102
+ </ ul >
103
+ </ div > < p > 显示一个只包含“确定”按钮的提示对话框。</ p >
104
+ < p > 该函数也可通过 < code > alert(title[, content])</ code > 来调用。调用时脚本将阻塞直至对话框被关闭。该函数无返回值。</ p >
105
+ < h2 > dialogs.confirm(title[, content])< span > < a class ="mark " href ="#dialogs_dialogs_confirm_title_content " id ="dialogs_dialogs_confirm_title_content "> #</ a > </ span > </ h2 >
106
+ < div class ="signature "> < ul >
107
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
108
+ < li > < code > content</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 可选,对话框的内容。默认为空。</ li >
109
+ </ ul >
110
+ </ div > < p > 显示一个包含“确定”和“取消”按钮的提示对话框。</ p >
111
+ < p > 该函数也可通过 < code > confirm(title[, content])</ code > 来调用。调用时脚本将阻塞直至对话框被关闭。如果用户点击“确定”则返回 < code > true</ code > ,否则返回 < code > false</ code > 。</ p >
112
+ < h2 > dialogs.select(title, items)< span > < a class ="mark " href ="#dialogs_dialogs_select_title_items " id ="dialogs_dialogs_select_title_items "> #</ a > </ span > </ h2 >
113
+ < div class ="signature "> < ul >
114
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
115
+ < li > < code > items</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array " class ="type "> <Array></ a > 对话框的选项列表,是一个字符串数组。</ li >
116
+ </ ul >
117
+ </ div > < p > 显示一个带有选项列表的对话框。</ p >
118
+ < p > 该函数也可通过 < code > dialogs.select(title, ...items)</ code > 来调用。< br > 例如: < code > dialogs.select("标题", ["A", "B", "C"])</ code > 可以用 < code > dialogs.select("标题", "A", "B", "C")</ code > 替代。</ p >
119
+ < p > 调用时脚本将阻塞直至对话框被关闭。如果用户点击了对话框中的某个选项,该函数会返回该选项的位置(选中第一个选项返回0,第二个选项返回1,以此类推),否则返回-1。</ p >
120
+ < h2 > dialogs.singleChoice(title, items[, index])< span > < a class ="mark " href ="#dialogs_dialogs_singlechoice_title_items_index " id ="dialogs_dialogs_singlechoice_title_items_index "> #</ a > </ span > </ h2 >
121
+ < div class ="signature "> < ul >
122
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
123
+ < li > < code > items</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array " class ="type "> <Array></ a > 对话框的选项列表,是一个字符串数组。</ li >
124
+ < li > < code > index</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type " class ="type "> <number></ a > 可选,对话框的默认选项的位置。默认为0。</ li >
125
+ </ ul >
126
+ </ div > < p > 显示一个带有单选框选项列表的对话框。</ p >
127
+ < p > 调用时脚本将阻塞直至对话框被关闭。如果用户选中了对话框中的某个选项并点击“确定”,该函数会返回该选项的位置(选中第一个选项返回0,第二个选项返回1,以此类推),否则返回-1。</ p >
128
+ < h2 > dialogs.multiChoice(title, items[, indexes])< span > < a class ="mark " href ="#dialogs_dialogs_multichoice_title_items_indexes " id ="dialogs_dialogs_multichoice_title_items_indexes "> #</ a > </ span > </ h2 >
129
+ < div class ="signature "> < ul >
130
+ < li > < code > title</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type " class ="type "> <string></ a > 对话框的标题。</ li >
131
+ < li > < code > items</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array " class ="type "> <Array></ a > 对话框的选项列表,是一个字符串数组。</ li >
132
+ < li > < code > indexes</ code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array " class ="type "> <Array></ a > 可选,对话框的默认选项的位置数组。默认为空数组。</ li >
133
+ </ ul >
134
+ </ div > < p > 显示一个带有多选框选项列表的对话框。</ p >
135
+ < p > 调用时脚本将阻塞直至对话框被关闭。如果用户点击“确定”按钮,该函数会返回所有已选选项的位置组成的数组,否则返回空数组。</ p >
136
+
137
+ </ div >
138
+ </ div >
139
+ </ div >
140
+ < script src ="assets/sh_main.js "> </ script >
141
+ < script src ="assets/sh_javascript.min.js "> </ script >
142
+ < script > highlight ( undefined , undefined , 'pre' ) ; </ script >
143
+ <!-- __TRACKING__ -->
144
+ </ body >
145
+ </ html >
0 commit comments