Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; By Frank Bauhn Comfort Hotel Stockholm
  2. #NoEnv
  3. #SingleInstance ignore
  4. SetTitleMatchMode, 2
  5.  
  6. Gui, Add, Text, x6 y7 w360 h30 +Center, Choose An Option For Reservation Overview
  7.  
  8. Gui, Add, Text, x6 y27 w360 h30 +Center, (Press F4 To Exit)
  9.  
  10. Gui, Add, Radio, x126 y47 w100 h30 vAnswer1 Checked group, Advance Folio
  11.  
  12. Gui, Add, Radio, x126 y87 w130 h30 vAnswer2, Close Further Postings
  13. Gui, Font, bold
  14. Gui, Add, Button, x66 y127 w240 h60 ,Go
  15. Gui, Font, normal
  16. Gui, Show, x375 y245 h197 w377, By Frank Comfort Hotel Stockholm v.1
  17.  
  18. Return
  19.  
  20. KillComment:
  21. IfWinExist, Cenium Comment Sheet
  22. {
  23. Send {Esc}
  24. }
  25. Return
  26.  
  27.  
  28.  
  29. ButtonGo:
  30. SetTimer, KillComment, 100
  31. Gui, Submit, NoHide
  32.  
  33. Gui, +OwnDialogs
  34.  
  35. clipboard =
  36. Gui, Hide
  37. WinActivate, Microsoft Dynamics NAV Classic
  38. WinWaitActive, Microsoft Dynamics NAV Classic, , 2
  39. Send !-x
  40. Send ^{F12}{DOWN  5}
  41. WinWaitActive, Reservation Overview, , 2
  42. if ErrorLevel
  43. {
  44.     SetTimer, KillComment, Off
  45.     MsgBox, 48, Error, Can't Find Window Reservation Overview!
  46.     Gui, Show
  47.     return
  48. }
  49. Send ^a
  50. Sleep, 300
  51. Send ^c
  52. ClipWait, 3
  53. var := clipboard
  54. StringReplace, var, var, `n, `n, UseErrorLevel
  55. clipboard =
  56. Rounds = %ErrorLevel%
  57. Send ^{Home}
  58. if (Rounds = 0)
  59. {
  60.     SetTimer, KillComment, Off
  61.     MsgBox, 48, Error, Data Missing!
  62.     Gui, Show
  63.     return
  64. }
  65. if Answer1
  66. {
  67. Loop, %Rounds%
  68. {
  69. Progress,B fs18 zh0  w185 h50 Cblack,Done %A_Index% Of %Rounds%,,Arial
  70. Send ^{F11}
  71. WinWaitActive, Check Out - Folio
  72. Send !ua
  73. Send {Esc}
  74. WinWaitActive, Reservation Overview
  75. Send {DOWN}
  76. }
  77. Progress, Off
  78. MsgBox, 0, Folio Has Been Advanced, %Rounds% Reservations Done!
  79. ExitApp
  80. }
  81.  
  82. else if Answer2
  83. {
  84. Loop, %Rounds%
  85. {
  86. Progress,B fs18 zh0  w185 h50 Cblack,Done %A_Index% Of %Rounds%,,Arial
  87. Send ^{F11}
  88. WinWaitActive, Check Out - Folio
  89. Send ^{up}{RIGHT  3}{UP  4}{Space}
  90. Send {Esc}
  91. WinWaitActive, Reservation Overview
  92. Send {Down}
  93. }
  94. Progress, Off
  95. MsgBox, 0, Closed Postings, %Rounds% Reservations Done!
  96. ExitApp
  97. }
  98.  
  99.  
  100.  
  101. GuiClose:
  102. ExitApp
  103.  
  104. F4::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement