2

I'm trying to have Gimp batch process some files in OSX. The best example I've found is in this post: How to run python scripts using gimpfu from command line?. However for launching Gimp in batch mode, this, and every other example starts looks like this:

gimp -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import batch;batch.run('./images')" -b "pdb.gimp_quit(1)

I can't just type "gimp" at my OSX command line though. I have to type "open /Applications/GIMP-2.10.app" and then including the various command line arguments throws up errors related to the "open" command.

I tried making an alias in my bash profile so that typing "gimp" launches "open /Applications/GIMP-2.10.app" but I'm still getting open errors.

Is there something else I need to do in OSX to just be able to type "gimp" and launch with command line args?

Tim B.
  • 47
  • 3

3 Answers3

2

You need to make your alias /Applications/GIMP-2.10.app/Contents/MacOS/gimp. That's where the traditional executables live. Or, make a symbolic link in /usr/local/bin.

Tim Roberts
  • 48,973
  • 4
  • 21
  • 30
1

For the dummies like me: You can add the alias to the ~/.alias file. Add the line:

alias mygimpname "/Applications/Gimp-2.10.app/Contents/MacOS/gimp"

Save the file Then type this in the terminal:

source ~/.alias

If you put a symbolic link in the bin directory, when you run gimp it fails with errors that the babl installation is broken. And then you need a workaround for that... Just use the alias.

Emma
  • 11
  • 2
  • getting `source: command not found` – t q Oct 26 '22 at 21:57
  • (1) The path needs to be updated to the current GIMP app. In my case that's "/Applications/Gimp-2.10.34.app/Contents/MacOS/gimp" . (2) Also, the syntax of the "alias" command that I needed was "alias gimpcmd="/Applications/..." with an "=" instead of a space. – August Jun 22 '23 at 22:51
0

Tim Roberts's suggestion of making my alias /Applications/GIMP-2.10.app/Contents/MacOS/gimp worked. Although I later learned shell scripts don't use system aliases, I at least have a command line alias, and can call the full path from a shell script.

Thank you!

Tim B.
  • 47
  • 3