| 1 | #include <GUIConstantsEx.au3>
|
|---|
| 2 |
|
|---|
| 3 | Opt('MustDeclareVars', 1)
|
|---|
| 4 |
|
|---|
| 5 | AutoReduceMain()
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | ; Func AutoReduceMain()
|
|---|
| 9 | ;This function currently runs the show;
|
|---|
| 10 | Func AutoReduceMain()
|
|---|
| 11 | Local $msg, $btn
|
|---|
| 12 | Local $File_Name, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory
|
|---|
| 13 | Local $File_Name_Box, $Exposure_Time_Box, $FrameRate_Box, $Total_Frames_Box, $Working_Directory_Box
|
|---|
| 14 |
|
|---|
| 15 | Local $File_Name1,$File_Name2,$File_Name3,$File_Name4,$File_Name5,$File_Name6,$File_Name7,$File_Name8,$File_Name9,$File_Name10
|
|---|
| 16 | Local $File_Name1_Box,$File_Name2_Box,$File_Name3_Box,$File_Name4_Box,$File_Name5_Box,$File_Name6_Box,$File_Name7_Box,$File_Name8_Box,$File_Name9_Box,$File_Name10_Box
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | GUICreate("AutoReduce", 500, 550, @DesktopWidth / 4 , @DesktopHeight / 4 , -1, 0x00000018)
|
|---|
| 21 |
|
|---|
| 22 | ;input boxes
|
|---|
| 23 | $File_Name_Box = GUICtrlCreateInput("F:\Alex\Unedited Files\capturew.avi", 10, 5, 300, 20)
|
|---|
| 24 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 25 | GUICtrlCreateLabel("Drag raw file here", 355, 5)
|
|---|
| 26 |
|
|---|
| 27 | $File_Name1_Box = GUICtrlCreateInput("", 10, 35, 300, 20)
|
|---|
| 28 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 29 | GUICtrlCreateLabel("Drag raw file here", 355, 35)
|
|---|
| 30 |
|
|---|
| 31 | $File_Name2_Box = GUICtrlCreateInput("", 10, 65, 300, 20)
|
|---|
| 32 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 33 | GUICtrlCreateLabel("Drag raw file here", 355, 65)
|
|---|
| 34 |
|
|---|
| 35 | $File_Name3_Box = GUICtrlCreateInput("", 10, 95, 300, 20)
|
|---|
| 36 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 37 | GUICtrlCreateLabel("Drag raw file here", 355, 95)
|
|---|
| 38 |
|
|---|
| 39 | $File_Name4_Box = GUICtrlCreateInput("", 10, 125, 300, 20)
|
|---|
| 40 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 41 | GUICtrlCreateLabel("Drag raw file here", 355, 125)
|
|---|
| 42 |
|
|---|
| 43 | $File_Name5_Box = GUICtrlCreateInput("", 10, 155, 300, 20)
|
|---|
| 44 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 45 | GUICtrlCreateLabel("Drag raw file here", 355, 155)
|
|---|
| 46 |
|
|---|
| 47 | $File_Name6_Box = GUICtrlCreateInput("", 10, 185, 300, 20)
|
|---|
| 48 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 49 | GUICtrlCreateLabel("Drag raw file here", 355, 185)
|
|---|
| 50 |
|
|---|
| 51 | $File_Name7_Box = GUICtrlCreateInput("", 10, 215, 300, 20)
|
|---|
| 52 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 53 | GUICtrlCreateLabel("Drag raw file here", 355, 215)
|
|---|
| 54 |
|
|---|
| 55 | $File_Name8_Box = GUICtrlCreateInput("", 10, 245, 300, 20)
|
|---|
| 56 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 57 | GUICtrlCreateLabel("Drag raw file here", 355, 245)
|
|---|
| 58 |
|
|---|
| 59 | $File_Name9_Box = GUICtrlCreateInput("", 10, 275, 300, 20)
|
|---|
| 60 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 61 | GUICtrlCreateLabel("Drag raw file here", 355, 275)
|
|---|
| 62 |
|
|---|
| 63 | $File_Name10_Box = GUICtrlCreateInput("", 10, 305, 300, 20)
|
|---|
| 64 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 65 | GUICtrlCreateLabel("Drag raw file here", 355, 305)
|
|---|
| 66 |
|
|---|
| 67 | GUICtrlCreateLabel("//-----------------------------------------------------------------------------------------------------------------------------------------------//", 25, 327)
|
|---|
| 68 | $Working_Directory_Box = GUICtrlCreateInput("F:\Alex\output", 10, 345, 300, 20)
|
|---|
| 69 | GUICtrlSetState(-1, $GUI_DROPACCEPTED) ;accept drag & drop files for previous input control
|
|---|
| 70 | GUICtrlCreateLabel("Directory for processed files", 355, 345)
|
|---|
| 71 |
|
|---|
| 72 | $Exposure_Time_Box = GUICtrlCreateInput("2", 10, 375, 50, 20)
|
|---|
| 73 | GUICtrlCreateLabel("Exposure Time", 355, 375)
|
|---|
| 74 |
|
|---|
| 75 | $FrameRate_Box = GUICtrlCreateInput("30", 10, 405, 50, 20)
|
|---|
| 76 | GUICtrlCreateLabel("Framerate", 355,405 )
|
|---|
| 77 |
|
|---|
| 78 | $Total_Frames_Box = GUICtrlCreateInput("4500", 10, 435, 50, 20)
|
|---|
| 79 | GUICtrlCreateLabel("Total number of frames", 355, 435)
|
|---|
| 80 |
|
|---|
| 81 | $btn = GUICtrlCreateButton("Ok", 10, 465, 60, 20)
|
|---|
| 82 |
|
|---|
| 83 | ;wait for OK click
|
|---|
| 84 | GUISetState()
|
|---|
| 85 | $msg = 0
|
|---|
| 86 | While $msg <> $GUI_EVENT_CLOSE
|
|---|
| 87 | $msg = GUIGetMsg()
|
|---|
| 88 | Select
|
|---|
| 89 | Case $msg = $btn
|
|---|
| 90 | ExitLoop
|
|---|
| 91 | EndSelect
|
|---|
| 92 | WEnd
|
|---|
| 93 |
|
|---|
| 94 | ;get settings
|
|---|
| 95 | $File_Name = GUICtrlRead($File_Name_Box)
|
|---|
| 96 | $File_Name1 = GUICtrlRead($File_Name1_Box)
|
|---|
| 97 | $File_Name2 = GUICtrlRead($File_Name2_Box)
|
|---|
| 98 | $File_Name3 = GUICtrlRead($File_Name3_Box)
|
|---|
| 99 | $File_Name4 = GUICtrlRead($File_Name4_Box)
|
|---|
| 100 | $File_Name5 = GUICtrlRead($File_Name5_Box)
|
|---|
| 101 | $File_Name6 = GUICtrlRead($File_Name6_Box)
|
|---|
| 102 | $File_Name7 = GUICtrlRead($File_Name7_Box)
|
|---|
| 103 | $File_Name8 = GUICtrlRead($File_Name8_Box)
|
|---|
| 104 | $File_Name9 = GUICtrlRead($File_Name9_Box)
|
|---|
| 105 | $File_Name10 = GUICtrlRead($File_Name10_Box)
|
|---|
| 106 | $Exposure_Time = GUICtrlRead($Exposure_Time_Box)
|
|---|
| 107 | $FrameRate = GUICtrlRead($FrameRate_Box)
|
|---|
| 108 | $Total_Frames = GUICtrlRead($Total_Frames_Box)
|
|---|
| 109 | $Working_Directory = GUICtrlRead($Working_Directory_Box)
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | Local $i
|
|---|
| 113 | for $i = 1 to 11
|
|---|
| 114 |
|
|---|
| 115 | Switch Int($i)
|
|---|
| 116 | Case 1
|
|---|
| 117 | if $File_Name <> "" Then
|
|---|
| 118 | ReduceRaw($File_Name, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 119 | EndIf
|
|---|
| 120 | Case 2
|
|---|
| 121 | if $File_Name1 <> "" Then
|
|---|
| 122 | ReduceRaw($File_Name1, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 123 | EndIf
|
|---|
| 124 | Case 3
|
|---|
| 125 | if $File_Name2 <> "" Then
|
|---|
| 126 | ReduceRaw($File_Name2, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 127 | EndIf
|
|---|
| 128 | Case 4
|
|---|
| 129 | if $File_Name3 <> "" Then
|
|---|
| 130 | ReduceRaw($File_Name3, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 131 | EndIf
|
|---|
| 132 | Case 5
|
|---|
| 133 | if $File_Name4 <> "" Then
|
|---|
| 134 | ReduceRaw($File_Name4, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 135 | EndIf
|
|---|
| 136 | Case 6
|
|---|
| 137 | if $File_Name5 <> "" Then
|
|---|
| 138 | ReduceRaw($File_Name5, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 139 | EndIf
|
|---|
| 140 | Case 7
|
|---|
| 141 | if $File_Name6 <> "" Then
|
|---|
| 142 | ReduceRaw($File_Name6, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 143 | EndIf
|
|---|
| 144 | Case 8
|
|---|
| 145 | if $File_Name7 <> "" Then
|
|---|
| 146 | ReduceRaw($File_Name7, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 147 | EndIf
|
|---|
| 148 | Case 9
|
|---|
| 149 | if $File_Name8 <> "" Then
|
|---|
| 150 | ReduceRaw($File_Name8, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 151 | EndIf
|
|---|
| 152 | Case 10
|
|---|
| 153 | if $File_Name9 <> "" Then
|
|---|
| 154 | ReduceRaw($File_Name9, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 155 | EndIf
|
|---|
| 156 | Case 11
|
|---|
| 157 | if $File_Name10 <> "" Then
|
|---|
| 158 | ReduceRaw($File_Name10, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 159 | EndIf
|
|---|
| 160 | Case Else
|
|---|
| 161 | ;
|
|---|
| 162 | EndSwitch
|
|---|
| 163 | Next
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 | EndFunc
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 | ;func ReduceRaw()
|
|---|
| 172 | ;This function takes the input for a specific file and performs the VirtualDub and ImageJ reduction
|
|---|
| 173 | Func ReduceRaw($File_Name, $Exposure_Time, $FrameRate, $Total_Frames, $Working_Directory)
|
|---|
| 174 |
|
|---|
| 175 | WinSetState("AutoReduce", "", @SW_MINIMIZE)
|
|---|
| 176 |
|
|---|
| 177 | ;start VirtualDub
|
|---|
| 178 | Run("VirtualDub.exe")
|
|---|
| 179 | WinWaitActive("VirtualDub")
|
|---|
| 180 |
|
|---|
| 181 | ;open file to be processed
|
|---|
| 182 | Send("!f")
|
|---|
| 183 | Send("{ENTER}")
|
|---|
| 184 | Send($File_Name)
|
|---|
| 185 | Send("{ENTER}")
|
|---|
| 186 |
|
|---|
| 187 | ;apply 2:1 high quality reduction
|
|---|
| 188 | WinWaitActive("VirtualDub")
|
|---|
| 189 | Send("^f")
|
|---|
| 190 | WinActivate("Filters")
|
|---|
| 191 | WinWaitActive("Filters")
|
|---|
| 192 | Send("!a")
|
|---|
| 193 | Send("{LEFT}")
|
|---|
| 194 | Send("{ENTER}")
|
|---|
| 195 | Send("{ENTER}")
|
|---|
| 196 |
|
|---|
| 197 | ;delete redundant frames
|
|---|
| 198 | If $Exposure_Time == "2" Then
|
|---|
| 199 | WinWaitActive("VirtualDub")
|
|---|
| 200 | Send("^r")
|
|---|
| 201 | WinActivate("Video Frame Rate Control")
|
|---|
| 202 | ControlClick("Video frame rate control", "", "Button7")
|
|---|
| 203 | Send("{ENTER}")
|
|---|
| 204 | EndIf
|
|---|
| 205 |
|
|---|
| 206 | ;select first quarter
|
|---|
| 207 | WinWaitActive("VirtualDub 1.8")
|
|---|
| 208 | Send("^g")
|
|---|
| 209 | Send("0")
|
|---|
| 210 | Send("{ENTER}")
|
|---|
| 211 | Send("{HOME}")
|
|---|
| 212 | Send("^g")
|
|---|
| 213 | Send("2250")
|
|---|
| 214 | Send("{ENTER}")
|
|---|
| 215 | Send("{END}")
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 | ;save first quarter reduced .avi
|
|---|
| 220 | Send("!f")
|
|---|
| 221 | Send("a")
|
|---|
| 222 | Send($Working_Directory)
|
|---|
| 223 | Send("\")
|
|---|
| 224 | Send("1")
|
|---|
| 225 | Send("{ENTER}")
|
|---|
| 226 | if WinActive("Save AVI 2.0 File") OR WinActive("Save") Then
|
|---|
| 227 | Send("{LEFT}")
|
|---|
| 228 | Send("{ENTER}")
|
|---|
| 229 | EndIf
|
|---|
| 230 |
|
|---|
| 231 | ;select second quarter
|
|---|
| 232 | WinWaitActive("VirtualDub 1.8")
|
|---|
| 233 | Send("^g")
|
|---|
| 234 | Send("2250")
|
|---|
| 235 | Send("{ENTER}")
|
|---|
| 236 | Send("{HOME}")
|
|---|
| 237 | Send("^g")
|
|---|
| 238 | Send("4500")
|
|---|
| 239 | Send("{ENTER}")
|
|---|
| 240 | Send("{END}")
|
|---|
| 241 |
|
|---|
| 242 | ;save second quarter reduced .avi
|
|---|
| 243 | Send("!f")
|
|---|
| 244 | Send("a")
|
|---|
| 245 | Send($Working_Directory)
|
|---|
| 246 | Send("\")
|
|---|
| 247 | Send("2")
|
|---|
| 248 | Send("{ENTER}")
|
|---|
| 249 | if WinActive("Save AVI 2.0 File") OR WinActive("Save") Then
|
|---|
| 250 | Send("{LEFT}")
|
|---|
| 251 | Send("{ENTER}")
|
|---|
| 252 | EndIf
|
|---|
| 253 |
|
|---|
| 254 | ;select third quarter
|
|---|
| 255 | WinWaitActive("VirtualDub 1.8")
|
|---|
| 256 | Send("^g")
|
|---|
| 257 | Send("4500")
|
|---|
| 258 | Send("{ENTER}")
|
|---|
| 259 | Send("{HOME}")
|
|---|
| 260 | Send("^g")
|
|---|
| 261 | Send("6750")
|
|---|
| 262 | Send("{ENTER}")
|
|---|
| 263 | Send("{END}")
|
|---|
| 264 |
|
|---|
| 265 | ;save third quarter reduced .avi
|
|---|
| 266 | Send("!f")
|
|---|
| 267 | Send("a")
|
|---|
| 268 | Send($Working_Directory)
|
|---|
| 269 | Send("\")
|
|---|
| 270 | Send("3")
|
|---|
| 271 | Send("{ENTER}")
|
|---|
| 272 | if WinActive("Save AVI 2.0 File") OR WinActive("Save") Then
|
|---|
| 273 | Send("{LEFT}")
|
|---|
| 274 | Send("{ENTER}")
|
|---|
| 275 | EndIf
|
|---|
| 276 |
|
|---|
| 277 | ;select fourth quarter
|
|---|
| 278 | WinWaitActive("VirtualDub 1.8")
|
|---|
| 279 | Send("^g")
|
|---|
| 280 | Send("6750")
|
|---|
| 281 | Send("{ENTER}")
|
|---|
| 282 | Send("{HOME}")
|
|---|
| 283 | Send("^g")
|
|---|
| 284 | Send("9000")
|
|---|
| 285 | Send("{ENTER}")
|
|---|
| 286 | Send("{END}")
|
|---|
| 287 |
|
|---|
| 288 | ;save fourth quarter reduced .avi
|
|---|
| 289 | Send("!f")
|
|---|
| 290 | Send("a")
|
|---|
| 291 | Send($Working_Directory)
|
|---|
| 292 | Send("\")
|
|---|
| 293 | Send("4")
|
|---|
| 294 |
|
|---|
| 295 | #CS
|
|---|
| 296 | Send("{ENTER}")
|
|---|
| 297 | if WinActive("Save AVI 2.0 File") OR WinActive("Save") Then
|
|---|
| 298 | Send("{LEFT}")
|
|---|
| 299 | Send("{ENTER}")
|
|---|
| 300 | EndIf
|
|---|
| 301 |
|
|---|
| 302 | ;exit VirtualDub
|
|---|
| 303 | WinWaitActive("VirtualDub 1.8")
|
|---|
| 304 | Send("!f")
|
|---|
| 305 | Send("q")
|
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 | ;start ImageJ
|
|---|
| 309 | Run("ImageJ.exe")
|
|---|
| 310 | WinWaitActive("ImageJ")
|
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 | ;open file 1
|
|---|
| 314 | Send("^o")
|
|---|
| 315 | WinWaitActive("Open")
|
|---|
| 316 | Send($Working_Directory)
|
|---|
| 317 | Send("\")
|
|---|
| 318 | Send("1.avi")
|
|---|
| 319 | Send("{ENTER}")
|
|---|
| 320 |
|
|---|
| 321 | ;select imageJ window
|
|---|
| 322 | WinWaitActive("1.avi")
|
|---|
| 323 | WinActivate("ImageJ")
|
|---|
| 324 | WinWaitActive("ImageJ")
|
|---|
| 325 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 326 |
|
|---|
| 327 | ;reduce to 8-Bit
|
|---|
| 328 | ;alt right right down right enter
|
|---|
| 329 | WinWaitActive("ImageJ")
|
|---|
| 330 | Send("{ALT}")
|
|---|
| 331 | Send("{RIGHT}")
|
|---|
| 332 | Send("{RIGHT}")
|
|---|
| 333 | Send("{DOWN}")
|
|---|
| 334 | Send("{RIGHT}")
|
|---|
| 335 | Send("{ENTER}")
|
|---|
| 336 | WinWaitActive("ImageJ")
|
|---|
| 337 |
|
|---|
| 338 | ;save
|
|---|
| 339 | WinActivate("ImageJ")
|
|---|
| 340 | WinWaitActive("ImageJ")
|
|---|
| 341 | Send("{ALT}")
|
|---|
| 342 | Send("{DOWN}")
|
|---|
| 343 | Send("{DOWN}")
|
|---|
| 344 | Send("{DOWN}")
|
|---|
| 345 | Send("{DOWN}")
|
|---|
| 346 | Send("{DOWN}")
|
|---|
| 347 | Send("{DOWN}")
|
|---|
| 348 | Send("{DOWN}")
|
|---|
| 349 | Send("{DOWN}")
|
|---|
| 350 | Send("{DOWN}")
|
|---|
| 351 | Send("{RIGHT}")
|
|---|
| 352 | Send("{DOWN}")
|
|---|
| 353 | Send("{DOWN}")
|
|---|
| 354 | Send("{DOWN}")
|
|---|
| 355 | Send("{DOWN}")
|
|---|
| 356 | Send("{DOWN}")
|
|---|
| 357 | Send("{DOWN}")
|
|---|
| 358 | Send("{DOWN}")
|
|---|
| 359 | Send("{ENTER}")
|
|---|
| 360 | WinWaitActive("Save as AVI...")
|
|---|
| 361 | Send("{ENTER}")
|
|---|
| 362 | Send("y")
|
|---|
| 363 | Sleep(3500)
|
|---|
| 364 |
|
|---|
| 365 | ;close file
|
|---|
| 366 | WinActivate("ImageJ")
|
|---|
| 367 | WinWaitActive("ImageJ")
|
|---|
| 368 | Send("^w")
|
|---|
| 369 | WinWaitActive("ImageJ")
|
|---|
| 370 | Send("n")
|
|---|
| 371 |
|
|---|
| 372 | ;open file 2
|
|---|
| 373 | Send("^o")
|
|---|
| 374 | WinWaitActive("Open")
|
|---|
| 375 | Send($Working_Directory)
|
|---|
| 376 | Send("\")
|
|---|
| 377 | Send("2.avi")
|
|---|
| 378 | Send("{ENTER}")
|
|---|
| 379 |
|
|---|
| 380 | ;select imageJ window
|
|---|
| 381 | WinWaitActive("2.avi")
|
|---|
| 382 | WinActivate("ImageJ")
|
|---|
| 383 | WinWaitActive("ImageJ")
|
|---|
| 384 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 385 |
|
|---|
| 386 | ;reduce to 8-Bit
|
|---|
| 387 | ;alt right right down right enter
|
|---|
| 388 | WinWaitActive("ImageJ")
|
|---|
| 389 | Send("{ALT}")
|
|---|
| 390 | Send("{RIGHT}")
|
|---|
| 391 | Send("{RIGHT}")
|
|---|
| 392 | Send("{DOWN}")
|
|---|
| 393 | Send("{RIGHT}")
|
|---|
| 394 | Send("{ENTER}")
|
|---|
| 395 | WinWaitActive("ImageJ")
|
|---|
| 396 |
|
|---|
| 397 | ;save
|
|---|
| 398 | WinActivate("ImageJ")
|
|---|
| 399 | WinWaitActive("ImageJ")
|
|---|
| 400 | Send("{ALT}")
|
|---|
| 401 | Send("{DOWN}")
|
|---|
| 402 | Send("{DOWN}")
|
|---|
| 403 | Send("{DOWN}")
|
|---|
| 404 | Send("{DOWN}")
|
|---|
| 405 | Send("{DOWN}")
|
|---|
| 406 | Send("{DOWN}")
|
|---|
| 407 | Send("{DOWN}")
|
|---|
| 408 | Send("{DOWN}")
|
|---|
| 409 | Send("{DOWN}")
|
|---|
| 410 | Send("{RIGHT}")
|
|---|
| 411 | Send("{DOWN}")
|
|---|
| 412 | Send("{DOWN}")
|
|---|
| 413 | Send("{DOWN}")
|
|---|
| 414 | Send("{DOWN}")
|
|---|
| 415 | Send("{DOWN}")
|
|---|
| 416 | Send("{DOWN}")
|
|---|
| 417 | Send("{DOWN}")
|
|---|
| 418 | Send("{ENTER}")
|
|---|
| 419 | WinWaitActive("Save as AVI...")
|
|---|
| 420 | Send("{ENTER}")
|
|---|
| 421 | Send("y")
|
|---|
| 422 | Sleep(3500)
|
|---|
| 423 |
|
|---|
| 424 | ;close file
|
|---|
| 425 | WinActivate("ImageJ")
|
|---|
| 426 | WinWaitActive("ImageJ")
|
|---|
| 427 | Send("^w")
|
|---|
| 428 | WinWaitActive("ImageJ")
|
|---|
| 429 | Send("n")
|
|---|
| 430 |
|
|---|
| 431 | ;open file 3
|
|---|
| 432 | Send("^o")
|
|---|
| 433 | WinWaitActive("Open")
|
|---|
| 434 | Send($Working_Directory)
|
|---|
| 435 | Send("\")
|
|---|
| 436 | Send("3.avi")
|
|---|
| 437 | Send("{ENTER}")
|
|---|
| 438 |
|
|---|
| 439 | ;select imageJ window
|
|---|
| 440 | WinWaitActive("3.avi")
|
|---|
| 441 | WinActivate("ImageJ")
|
|---|
| 442 | WinWaitActive("ImageJ")
|
|---|
| 443 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 444 |
|
|---|
| 445 | ;reduce to 8-Bit
|
|---|
| 446 | ;alt right right down right enter
|
|---|
| 447 | WinWaitActive("ImageJ")
|
|---|
| 448 | Send("{ALT}")
|
|---|
| 449 | Send("{RIGHT}")
|
|---|
| 450 | Send("{RIGHT}")
|
|---|
| 451 | Send("{DOWN}")
|
|---|
| 452 | Send("{RIGHT}")
|
|---|
| 453 | Send("{ENTER}")
|
|---|
| 454 | WinWaitActive("ImageJ")
|
|---|
| 455 |
|
|---|
| 456 | ;save
|
|---|
| 457 | WinActivate("ImageJ")
|
|---|
| 458 | WinWaitActive("ImageJ")
|
|---|
| 459 | Send("{ALT}")
|
|---|
| 460 | Send("{DOWN}")
|
|---|
| 461 | Send("{DOWN}")
|
|---|
| 462 | Send("{DOWN}")
|
|---|
| 463 | Send("{DOWN}")
|
|---|
| 464 | Send("{DOWN}")
|
|---|
| 465 | Send("{DOWN}")
|
|---|
| 466 | Send("{DOWN}")
|
|---|
| 467 | Send("{DOWN}")
|
|---|
| 468 | Send("{DOWN}")
|
|---|
| 469 | Send("{RIGHT}")
|
|---|
| 470 | Send("{DOWN}")
|
|---|
| 471 | Send("{DOWN}")
|
|---|
| 472 | Send("{DOWN}")
|
|---|
| 473 | Send("{DOWN}")
|
|---|
| 474 | Send("{DOWN}")
|
|---|
| 475 | Send("{DOWN}")
|
|---|
| 476 | Send("{DOWN}")
|
|---|
| 477 | Send("{ENTER}")
|
|---|
| 478 | WinWaitActive("Save as AVI...")
|
|---|
| 479 | Send("{ENTER}")
|
|---|
| 480 | Send("y")
|
|---|
| 481 | Sleep(3500)
|
|---|
| 482 |
|
|---|
| 483 | ;close file
|
|---|
| 484 | WinActivate("ImageJ")
|
|---|
| 485 | WinWaitActive("ImageJ")
|
|---|
| 486 | Send("^w")
|
|---|
| 487 | WinWaitActive("ImageJ")
|
|---|
| 488 | Send("n")
|
|---|
| 489 |
|
|---|
| 490 | ;open file 4
|
|---|
| 491 | Send("^o")
|
|---|
| 492 | WinWaitActive("Open")
|
|---|
| 493 | Send($Working_Directory)
|
|---|
| 494 | Send("\")
|
|---|
| 495 | Send("4.avi")
|
|---|
| 496 | Send("{ENTER}")
|
|---|
| 497 |
|
|---|
| 498 | ;select imageJ window
|
|---|
| 499 | WinWaitActive("4.avi")
|
|---|
| 500 | WinActivate("ImageJ")
|
|---|
| 501 | WinWaitActive("ImageJ")
|
|---|
| 502 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 503 |
|
|---|
| 504 | ;reduce to 8-Bit
|
|---|
| 505 | ;alt right right down right enter
|
|---|
| 506 | WinWaitActive("ImageJ")
|
|---|
| 507 | Send("{ALT}")
|
|---|
| 508 | Send("{RIGHT}")
|
|---|
| 509 | Send("{RIGHT}")
|
|---|
| 510 | Send("{DOWN}")
|
|---|
| 511 | Send("{RIGHT}")
|
|---|
| 512 | Send("{ENTER}")
|
|---|
| 513 | WinWaitActive("ImageJ")
|
|---|
| 514 |
|
|---|
| 515 | ;save
|
|---|
| 516 | WinActivate("ImageJ")
|
|---|
| 517 | WinWaitActive("ImageJ")
|
|---|
| 518 | Send("{ALT}")
|
|---|
| 519 | Send("{DOWN}")
|
|---|
| 520 | Send("{DOWN}")
|
|---|
| 521 | Send("{DOWN}")
|
|---|
| 522 | Send("{DOWN}")
|
|---|
| 523 | Send("{DOWN}")
|
|---|
| 524 | Send("{DOWN}")
|
|---|
| 525 | Send("{DOWN}")
|
|---|
| 526 | Send("{DOWN}")
|
|---|
| 527 | Send("{DOWN}")
|
|---|
| 528 | Send("{RIGHT}")
|
|---|
| 529 | Send("{DOWN}")
|
|---|
| 530 | Send("{DOWN}")
|
|---|
| 531 | Send("{DOWN}")
|
|---|
| 532 | Send("{DOWN}")
|
|---|
| 533 | Send("{DOWN}")
|
|---|
| 534 | Send("{DOWN}")
|
|---|
| 535 | Send("{DOWN}")
|
|---|
| 536 | Send("{ENTER}")
|
|---|
| 537 | WinWaitActive("Save as AVI...")
|
|---|
| 538 | Send("{ENTER}")
|
|---|
| 539 | Send("y")
|
|---|
| 540 | Sleep(3500)
|
|---|
| 541 |
|
|---|
| 542 | ;close file
|
|---|
| 543 | WinActivate("ImageJ")
|
|---|
| 544 | WinWaitActive("ImageJ")
|
|---|
| 545 | Send("^w")
|
|---|
| 546 | WinWaitActive("ImageJ")
|
|---|
| 547 | Send("n")
|
|---|
| 548 |
|
|---|
| 549 | ;load all files together
|
|---|
| 550 | ;open file 1
|
|---|
| 551 | Send("^o")
|
|---|
| 552 | WinWaitActive("Open")
|
|---|
| 553 | Send($Working_Directory)
|
|---|
| 554 | Send("\")
|
|---|
| 555 | Send("1.avi")
|
|---|
| 556 | Send("{ENTER}")
|
|---|
| 557 | WinWaitActive("1.avi")
|
|---|
| 558 | WinActivate("ImageJ")
|
|---|
| 559 | WinWaitActive("ImageJ")
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 | ;open file 2
|
|---|
| 563 | Send("^o")
|
|---|
| 564 | WinWaitActive("Open")
|
|---|
| 565 | Send($Working_Directory)
|
|---|
| 566 | Send("\")
|
|---|
| 567 | Send("2.avi")
|
|---|
| 568 | Send("{ENTER}")
|
|---|
| 569 | WinWaitActive("2.avi")
|
|---|
| 570 | WinActivate("ImageJ")
|
|---|
| 571 | WinWaitActive("ImageJ")
|
|---|
| 572 |
|
|---|
| 573 |
|
|---|
| 574 | ;open file 3
|
|---|
| 575 | Send("^o")
|
|---|
| 576 | WinWaitActive("Open")
|
|---|
| 577 | Send($Working_Directory)
|
|---|
| 578 | Send("\")
|
|---|
| 579 | Send("3.avi")
|
|---|
| 580 | Send("{ENTER}")
|
|---|
| 581 | WinWaitActive("3.avi")
|
|---|
| 582 | WinActivate("ImageJ")
|
|---|
| 583 | WinWaitActive("ImageJ")
|
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 | ;open file 4
|
|---|
| 587 | Send("^o")
|
|---|
| 588 | WinWaitActive("Open")
|
|---|
| 589 | Send($Working_Directory)
|
|---|
| 590 | Send("\")
|
|---|
| 591 | Send("4.avi")
|
|---|
| 592 | Send("{ENTER}")
|
|---|
| 593 | WinWaitActive("4.avi")
|
|---|
| 594 | WinActivate("ImageJ")
|
|---|
| 595 | WinWaitActive("ImageJ")
|
|---|
| 596 |
|
|---|
| 597 |
|
|---|
| 598 | ;concatenate files
|
|---|
| 599 |
|
|---|
| 600 | ;start with first and second files
|
|---|
| 601 | Send("{ALT}")
|
|---|
| 602 | Send("{RIGHT}")
|
|---|
| 603 | Send("{RIGHT}")
|
|---|
| 604 | Send("{RIGHT}")
|
|---|
| 605 | Send("{RIGHT}")
|
|---|
| 606 | Send("{RIGHT}")
|
|---|
| 607 | Send("{UP}")
|
|---|
| 608 | Send("{UP}")
|
|---|
| 609 | Send("{UP}")
|
|---|
| 610 | Send("{UP}")
|
|---|
| 611 | Send("{UP}")
|
|---|
| 612 | Send("{UP}")
|
|---|
| 613 | Send("{UP}")
|
|---|
| 614 | Send("{UP}")
|
|---|
| 615 | Send("{UP}")
|
|---|
| 616 | Send("{UP}")
|
|---|
| 617 | Send("{UP}")
|
|---|
| 618 | Send("{UP}")
|
|---|
| 619 | Send("{UP}")
|
|---|
| 620 | Send("{UP}")
|
|---|
| 621 | Send("{UP}")
|
|---|
| 622 | Send("{RIGHT}")
|
|---|
| 623 | Send("{DOWN}")
|
|---|
| 624 | Send("{ENTER}")
|
|---|
| 625 | WinWaitActive("Concatenator")
|
|---|
| 626 | Send("{ENTER}")
|
|---|
| 627 |
|
|---|
| 628 | ;change focus back to imageJ
|
|---|
| 629 | ;wait for window to activate
|
|---|
| 630 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 631 | WinActivate("ImageJ")
|
|---|
| 632 | WinWaitActive("ImageJ")
|
|---|
| 633 |
|
|---|
| 634 | ;concatenate third file
|
|---|
| 635 | Send("{ALT}")
|
|---|
| 636 | Send("{RIGHT}")
|
|---|
| 637 | Send("{RIGHT}")
|
|---|
| 638 | Send("{RIGHT}")
|
|---|
| 639 | Send("{RIGHT}")
|
|---|
| 640 | Send("{RIGHT}")
|
|---|
| 641 | Send("{UP}")
|
|---|
| 642 | Send("{UP}")
|
|---|
| 643 | Send("{UP}")
|
|---|
| 644 | Send("{UP}")
|
|---|
| 645 | Send("{UP}")
|
|---|
| 646 | Send("{UP}")
|
|---|
| 647 | Send("{UP}")
|
|---|
| 648 | Send("{UP}")
|
|---|
| 649 | Send("{UP}")
|
|---|
| 650 | Send("{UP}")
|
|---|
| 651 | Send("{UP}")
|
|---|
| 652 | Send("{UP}")
|
|---|
| 653 | Send("{UP}")
|
|---|
| 654 | Send("{UP}")
|
|---|
| 655 | Send("{UP}")
|
|---|
| 656 | Send("{RIGHT}")
|
|---|
| 657 | Send("{DOWN}")
|
|---|
| 658 | Send("{ENTER}")
|
|---|
| 659 | WinWaitActive("Concatenator")
|
|---|
| 660 | Send("{DOWN}")
|
|---|
| 661 | Send("{DOWN}")
|
|---|
| 662 | Send("{TAB}")
|
|---|
| 663 | Send("{UP}")
|
|---|
| 664 | Send("{ENTER}")
|
|---|
| 665 |
|
|---|
| 666 | ;change focus back to imageJ
|
|---|
| 667 | ;wait for window to activate
|
|---|
| 668 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 669 | WinActivate("ImageJ")
|
|---|
| 670 | WinWaitActive("ImageJ")
|
|---|
| 671 |
|
|---|
| 672 | ;concatenate fourth file
|
|---|
| 673 |
|
|---|
| 674 | Send("{ALT}")
|
|---|
| 675 | Send("{RIGHT}")
|
|---|
| 676 | Send("{RIGHT}")
|
|---|
| 677 | Send("{RIGHT}")
|
|---|
| 678 | Send("{RIGHT}")
|
|---|
| 679 | Send("{RIGHT}")
|
|---|
| 680 | Send("{UP}")
|
|---|
| 681 | Send("{UP}")
|
|---|
| 682 | Send("{UP}")
|
|---|
| 683 | Send("{UP}")
|
|---|
| 684 | Send("{UP}")
|
|---|
| 685 | Send("{UP}")
|
|---|
| 686 | Send("{UP}")
|
|---|
| 687 | Send("{UP}")
|
|---|
| 688 | Send("{UP}")
|
|---|
| 689 | Send("{UP}")
|
|---|
| 690 | Send("{UP}")
|
|---|
| 691 | Send("{UP}")
|
|---|
| 692 | Send("{UP}")
|
|---|
| 693 | Send("{UP}")
|
|---|
| 694 | Send("{UP}")
|
|---|
| 695 | Send("{RIGHT}")
|
|---|
| 696 | Send("{DOWN}")
|
|---|
| 697 | Send("{ENTER}")
|
|---|
| 698 | WinWaitActive("Concatenator")
|
|---|
| 699 | Send("{DOWN}")
|
|---|
| 700 | Send("{TAB}")
|
|---|
| 701 | Send("{UP}")
|
|---|
| 702 | Send("{ENTER}")
|
|---|
| 703 |
|
|---|
| 704 | ;change focus back to imageJ
|
|---|
| 705 | ;wait for window to activate
|
|---|
| 706 | WinWaitActive("Concatenated Stacks")
|
|---|
| 707 | WinSetState("ImageJ", "", @SW_SHOW)
|
|---|
| 708 | WinActivate("ImageJ")
|
|---|
| 709 | WinWaitActive("ImageJ")
|
|---|
| 710 |
|
|---|
| 711 | ;get original filename
|
|---|
| 712 | Dim $Path_Data[4]
|
|---|
| 713 | $Path_Data = _FileParsePath($File_Name)
|
|---|
| 714 | ;$Path_Data[3] = Name
|
|---|
| 715 | ;$Path_Data[4] = extension
|
|---|
| 716 |
|
|---|
| 717 | ;save
|
|---|
| 718 | WinActivate("ImageJ")
|
|---|
| 719 | WinWaitActive("ImageJ")
|
|---|
| 720 | Send("{ALT}")
|
|---|
| 721 | Send("{DOWN}")
|
|---|
| 722 | Send("{DOWN}")
|
|---|
| 723 | Send("{DOWN}")
|
|---|
| 724 | Send("{DOWN}")
|
|---|
| 725 | Send("{DOWN}")
|
|---|
| 726 | Send("{DOWN}")
|
|---|
| 727 | Send("{DOWN}")
|
|---|
| 728 | Send("{DOWN}")
|
|---|
| 729 | Send("{DOWN}")
|
|---|
| 730 | Send("{RIGHT}")
|
|---|
| 731 | Send("{DOWN}")
|
|---|
| 732 | Send("{DOWN}")
|
|---|
| 733 | Send("{DOWN}")
|
|---|
| 734 | Send("{DOWN}")
|
|---|
| 735 | Send("{DOWN}")
|
|---|
| 736 | Send("{DOWN}")
|
|---|
| 737 | Send("{DOWN}")
|
|---|
| 738 | Send("{ENTER}")
|
|---|
| 739 | WinWaitActive("Save as AVI...")
|
|---|
| 740 | Send($Working_Directory)
|
|---|
| 741 | Send("\")
|
|---|
| 742 | Send($Path_Data[2])
|
|---|
| 743 | Send("R.avi")
|
|---|
| 744 | Send("{ENTER}")
|
|---|
| 745 | Sleep(12000)
|
|---|
| 746 | WinActivate("ImageJ")
|
|---|
| 747 | WinWaitActive("ImageJ")
|
|---|
| 748 |
|
|---|
| 749 |
|
|---|
| 750 | ;exit ImageJ
|
|---|
| 751 |
|
|---|
| 752 | Send("{ALT}")
|
|---|
| 753 | Send("{UP}")
|
|---|
| 754 | Send("{UP}")
|
|---|
| 755 | Send("{ENTER}")
|
|---|
| 756 | Send("{ENTER}")
|
|---|
| 757 | #CE
|
|---|
| 758 |
|
|---|
| 759 | EndFunc
|
|---|
| 760 |
|
|---|
| 761 | ;===============================================================================
|
|---|
| 762 | ;
|
|---|
| 763 | ; Function Name: _FileParsePath
|
|---|
| 764 | ; Description: Takes a full path such as "C:\Path\File.Ext" and returns an array such as "C:","\Path\","File",".Ext"
|
|---|
| 765 | ; Parameter(s):
|
|---|
| 766 | ; Requirement(s):
|
|---|
| 767 | ; Return Value(s): A 4-element Array. See Description
|
|---|
| 768 | ; Author(s): Mike Ratzlaff <mike@ratzlaff.org>
|
|---|
| 769 | ;
|
|---|
| 770 | ;===============================================================================
|
|---|
| 771 | ;
|
|---|
| 772 | Func _FileParsePath($FileName)
|
|---|
| 773 | Dim $Return[4];Drive, Path, Name, Extension
|
|---|
| 774 | Dim $Len
|
|---|
| 775 | If StringMid($FileName, 2, 1) = ":" Then
|
|---|
| 776 | $Return[0] = StringLeft($FileName, 2)
|
|---|
| 777 | $FileName = StringRight($FileName, StringLen($FileName) - 2)
|
|---|
| 778 | Else
|
|---|
| 779 | $Return[0] = ''
|
|---|
| 780 | EndIf
|
|---|
| 781 | $Len = StringInStr($FileName, "\", 0, -1)
|
|---|
| 782 | $Return[1] = StringLeft($FileName, $Len)
|
|---|
| 783 | $FileName = StringRight($FileName, StringLen($FileName) - $Len)
|
|---|
| 784 | $Len = StringInStr($FileName, ".", 0, -1)
|
|---|
| 785 | $Return[2] = StringLeft($FileName, $Len - 1)
|
|---|
| 786 | $FileName = StringRight($FileName, StringLen($FileName) - $Len + 1)
|
|---|
| 787 | $Return[3] = $FileName
|
|---|
| 788 | Return $Return
|
|---|
| 789 | EndFunc ;==>_FileParsePath
|
|---|
| 790 |
|
|---|
| 791 | ;===============================================================================
|
|---|