0

我创建了一个复选框,然后创建了一个 GUI。但是,我想在同一个 GUI 中创建另一个复选框,但它告诉我需要在下面的 BOLD 部分输入“return”。

如果我这样做,我的脚本的其余部分将停止。基本上,如果用户选中“是”,那么我想要该 GUI 中的第二个 GUI。但是如果用户检查否,那么我希望热键跳到脚本的其余部分(不包括在下面)。

我怎么能那样做?

Send, {ENTER}
gui, font, s14
gui, add, checkbox, w200 y15 vyesy, YES
gui, add, checkbox, w200 vnon, NO
gui, add, button,  gfem, continue
gui, show, w200 h175, GYN EXAM?
Return

fem:
Gui, submit
Send, {space}
Sleep, 500


if non = 1
 {
 send, {space}
 }
gui, destroy
If yesy = 1
{
Send,GYN:{SPACE}
Progress, m2 b fs14 zh0, Date of LMP, , , Arial
Inputbox, LMP, LMP 
Progress, Off
Sleep, 500
Send,LMP{SPACE}%LMP%,{SPACE}
Progress, m2 b fs14 zh0, Duration`ndays wks mo  , , , Arial
Inputbox, duration, Duration 
Progress, Off
Sleep, 500
Send, Duration{SPACE}%duration%,{SPACE}
Progress, m2 b fs14 zh0, G_/P_ `nPlease include letters G&P, , , Arial
Inputbox, gp, G_/P_ 
Progress, Off
Sleep, 500
Send,%gp%{SPACE}

gui, font, s14
gui, add, checkbox, w115 y15 virreg, Irregular
gui, add, checkbox, w115 vhflow, Heavy flow
gui, add, checkbox, w115 vndys, Dysmenorrhia
gui, add, checkbox, w115 y15 x+8 vreg, Regular
gui, add, checkbox, w150 y+9 vflow, Normal flow
gui, add, checkbox, w200 y+9 vdysmenorrhia, No Dysmenorrhia
gui, Add, button, x120 y130 gGyYN, continue 
gui, Show, w400 h200, GYN
return


GYyN:
gui, Submit
SEND,{space}
Sleep, 500

if irreg = 1
 {
  send, -{space}Irregular{space}
Progress, m2 b fs14 zh0, Further details of `nirregular flow, , , Arial
Inputbox, irf, Irregular flow details
Progress, Off
Sleep, 500
Send,%irf%

 }
if hflow = 1
 {
  send, -{SPACE}Heavy flow{space}
Progress, m2 b fs14 zh0, Further details of `nheavy flow, , , Arial
Inputbox, hfl, Heavy flow details
Progress, Off
Sleep, 500
Send,%hfl%
 }
if ndys = 1
 {
  send, -{space}Dysmenorrhia{space}
Progress, m2 b fs14 zh0, Further details of `ndysmenorrhia, , , Arial
Inputbox, dysmni, Dysmenorrhia details
Progress, Off
Sleep, 500
Send,%dysmni%
  - Normal flow- No Dysmenorrhia
 }
if reg = 1
 {
  send, -{space}Regular
 }  
if flow = 1
 {
  send, -{space}Normal flow
 }
if dysmenorrhia = 1
 {
  send, -{SPACE}No Dysmenorrhia
**return**
 }}
gui, destroy
4

1 回答 1

0

AHK 不喜欢您在 If yesy = 1 块中打开第二个 GUI。如果你这样写,错误就会消失。

Send, {ENTER}
gui, font, s14
gui, add, checkbox, w200 y15 vyesy, YES
gui, add, checkbox, w200 vnon, NO
gui, add, button,  gfem, continue
gui, show, w200 h175, GYN EXAM?
Return

fem:
Gui, submit
Send, {space}
Sleep, 500

gui, destroy

if non = 1
 {
 send, {space}
 }

If yesy <> 1
  return


Send,GYN:{SPACE}
Progress, m2 b fs14 zh0, Date of LMP, , , Arial
Inputbox, LMP, LMP 
Progress, Off
Sleep, 500

Send,LMP{SPACE}%LMP%,{SPACE}
Progress, m2 b fs14 zh0, Duration`ndays wks mo  , , , Arial
Inputbox, duration, Duration 
Progress, Off
Sleep, 500

Send, Duration{SPACE}%duration%,{SPACE}
Progress, m2 b fs14 zh0, G_/P_ `nPlease include letters G&P, , , Arial
Inputbox, gp, G_/P_ 
Progress, Off
Sleep, 500

Send,%gp%{SPACE}

gui, font, s14
gui, add, checkbox, w115 y15 virreg, Irregular
gui, add, checkbox, w115 vhflow, Heavy flow
gui, add, checkbox, w115 vndys, Dysmenorrhia
gui, add, checkbox, w115 y15 x+8 vreg, Regular
gui, add, checkbox, w150 y+9 vflow, Normal flow
gui, add, checkbox, w200 y+9 vdysmenorrhia, No Dysmenorrhia
gui, Add, button, x120 y130 gGyYN2, continue 
gui, Show, w400 h200, GYN
return


GYyN2:
gui, Submit
SEND,{space}
Sleep, 500

if irreg = 1
 {
  send, -{space}Irregular{space}
Progress, m2 b fs14 zh0, Further details of `nirregular flow, , , Arial
Inputbox, irf, Irregular flow details
Progress, Off
Sleep, 500
Send,%irf%

 }

if hflow = 1
 {
  send, -{SPACE}Heavy flow{space}
Progress, m2 b fs14 zh0, Further details of `nheavy flow, , , Arial
Inputbox, hfl, Heavy flow details
Progress, Off
Sleep, 500
Send,%hfl%
 }

if ndys = 1
 {
  send, -{space}Dysmenorrhia{space}
Progress, m2 b fs14 zh0, Further details of `ndysmenorrhia, , , Arial
Inputbox, dysmni, Dysmenorrhia details
Progress, Off
Sleep, 500
Send,%dysmni%
  - Normal flow- No Dysmenorrhia
 }

if reg = 1
 {
  send, -{space}Regular
 }  

if flow = 1
 {
  send, -{space}Normal flow
 }

if dysmenorrhia = 1
 {
  send, -{SPACE}No Dysmenorrhia

 }

 gui, destroy
于 2013-08-17T14:43:48.667 回答