In bash, how to open .png file in a Mac app which only has “import” in the app menu

Solution 1:

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.