Page 1 of 1

Batch processing in the command line

Posted: 05.08.2025 19:16
by OGMacGyver
In another thread from 10 years ago viewtopic.php?p=19603&hilit=massive+batch#p19603

It was mentioned that "We might add an advanced batch processing command line support later, but for now you can write a script to iterate over a set of folders and invoke Focus for each of them one by one."

I’m using a robot to capture images of parts, and each stacking task is sent to the command line. However, every time a new command is executed, the command-line window forcibly takes focus of the screen. This interrupts whatever else I’m doing on the computer—for example, typing in a document or using a browser—because the focus shifts away from my current application to the command-line window. This repeated interruption makes it extremely difficult to multitask or use the computer productively while the robot is running.

I really need a way to complete focus stacking jobs in the background somehow. I am using python to run the robot and camera.

Any ideas?

Re: Batch processing in the command line

Posted: 05.08.2025 20:55
by Catherine
Have you tried changing your script to not create the console window? Something like this

Code: Select all

import subprocess
import os

subprocess.Popen(
    ["HeliconFocus.exe", "arg1", "arg2"],
    creationflags=subprocess.CREATE_NO_WINDOW,
    stdout=subprocess.DEVNULL,
    stderr=subprocess.DEVNULL
)

Re: Batch processing in the command line

Posted: 06.08.2025 13:17
by OGMacGyver
Thanks for the suggestion, was helpful to get to a solution. I am on MacOS so after some back and forward with chatGPT I modified the App's Info.plist

Edited the Info.plist of the Helicon Focus app bundle (e.g., /Applications/Helicon Focus.app/Contents/Info.plist) and added:

<key>LSUIElement</key>
<true/>

This tells macOS the app should behave as an "agent" and not show up in the Dock or App Switcher. This will apply to all launches of Helicon Focus, not just my script, but it was the only solution that worked for me.

Re: Batch processing in the command line

Posted: 06.08.2025 13:57
by Catherine
You can have two copies of the HeliconFocus.app: one vanilla for regular operation, the other with a modified .plist for your scripting needs. And thanks for sharing the solution!