 
 execute()
 {
-    AFM.export_jpg(1, "d:\ashihara\img", 178, 207)
+    ;~ AFM.export_jpg(1, "d:\ashihara\img", 178, 207)
+    
+    configs := [["30u", ".5Hz", "u", 18]
+                 , ["10u",  "1Hz", "d", 18]
+                 , ["3u",   "1Hz", "u", 9]
+                 , ["1u",   "1Hz", "d", 9]
+                 , ["300n", "1Hz", "u", 9]]
+    for index, config in configs
+    {
+        AFM.config_capture(config[1]
+            , config[2], config[3], config[4])
+    }
 }
 
 

#Include range.ahk

; Right click "H" mark in the taskbar to stop.
;~ SetKeyDelay 500

Space & e::ExitApp
Space & r::Reload

        }
    }
    
    config_capture(size, rate, u_or_d, capture_minutes)
    {
        ; Do NOT "Show all items" in "Scan Controls".
        ; Activate "Scan size".
        
        ; throw if u_or_d not in ["u", "d"]
        
        SetKeyDelay, 500
        WinActivate, NanoScope Control
        
        Send !ps  ; Panels -> Scan
        Send % size
        
        Send {Down}{Down}{Down}{Down}%rate%
        Send {Up}{Up}{Up}{Up}
        
        Send ^c  ; Capture
        Send !f%u_or_d%  ; Frame -> Up or Down
        
        sleep_minute(capture_minutes)
    }
        

    static dbg_cnt = 0
    dbg()
