Bash Command Line – Open .png File in Mac App with ‘Import’ Menu

applicationscommand linegraphics

I'm using 'engauge Digitizer' to digitize the charts (.png file). When to automate the process, I wish to write bash script or to use Python Subprocess library to control it. The first step is to import .png file to the app.

However, 'engauge Digitizer' doesn't work like other Mac apps, which can use bash "open".

$ open -a Preview '/path_to_file/picture.png' # This works.
$ open -a 'engauge Digitizer' '/path_to_file/picture.png' # This does not work.

Could you give some help?

Best Answer

engauge Digitizer indeed provides a CLI at least using the pkg installer available at github to install the app.

In theory you can simply enter a command in Terminal to either open a *.dig file (the native engauge Digitizer file format) or import one of the supported image formats (jpg/bmp/png etc.):

/Applications/Engauge\ Digitizer.app/Contents/MacOS/Engauge\ Digitizer -help
/Applications/Engauge\ Digitizer.app/Contents/MacOS/Engauge\ Digitizer ~/Data/test.jpg
/Applications/Engauge\ Digitizer.app/Contents/MacOS/Engauge\ Digitizer ~/Data/test.dig

The app (I've tested v.12.1 in 10.15.2 Catalina) has some serious sandbox issue though and even after enabling full disk access/Development/... for any app or exec involved, I get a deny-read warning in the Console in my whole user folder and all relevant subfolders:

Sandbox:     Engauge Digitize(1981) deny(1) file-read-data /Users/user/Data
Violation:     deny(1) file-read-data /Users/user/Data
Process:      Engauge Digitize [1981]
Path:           /Applications/Engauge Digitizer.app/Contents/MacOS/Engauge Digitizer
...


It works if you move the files directly to the container folder ~/Library/Containers/Digitizer/Data/ and open or import the files from there.

Importing files invokes some additional modal windows. I doubt that you can handle this with a shell script.


My advice: file an issue at the developer's github page.