Created
          September 16, 2025 16:23 
        
      - 
      
- 
        Save roguh/1868f8fecd4bebf7c19c65f3fb37efb6 to your computer and use it in GitHub Desktop. 
    mtplvcap_command.js: Send commands to mtplvcap, control your Nikon camera through the CLI. See https://github.com/puhitaku/mtplvcap
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env node | |
| const addr = process.env.MTPLVCAP_ADDRESS || "ws://localhost:42839/control" | |
| // TODO: add the other mtplvcap commands | |
| const payload = {af_focus_now: true} | |
| let ws = new WebSocket(addr) | |
| ws.onopen = () => { | |
| ws.send(JSON.stringify(payload)) | |
| ws.close(1000, "Normal Closure") | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment