Posts: 5
Threads: 2
Joined: Dec 2018
Reputation:
0
Operating system(s):
Gimp version: 2.10
01-04-2019, 05:07 AM
(This post was last modified: 01-04-2019, 05:17 AM by dataweary.)
Hi,
I'd like to open a file in Gimp as part of a shell script on OS X Sierra (I use the Partha Bagchi build).
If Gimp is not launched, it works perfectly with the following command:
open McGimp-2.10.8.app --args ~/Documents/Archive/scanpic.jpg
But I don't know how to open a file with the script when Gimp is already launched. In this case, Gimp comes to the forefront but the file is not opened.
Any idea how to achieve that?
dw
Posts: 6,362
Threads: 276
Joined: Oct 2016
Reputation:
565
Operating system(s):
Gimp version: 3.00RC1
Gimp should come to the forefront but with the image. You can anyway force Gimp to start a new independent Gimp instance using the -n (or --new-instance parameter) to make it use a new instance.
I can only recommend you to check the docs (or just gimp --help...) for other parameters that are useful when running in batch (-i, -v, -d...).
Posts: 5
Threads: 2
Joined: Dec 2018
Reputation:
0
Operating system(s):
Gimp version: 2.10
01-04-2019, 10:35 AM
(This post was last modified: 01-04-2019, 10:59 AM by dataweary.)
Thanks Ofnuts and Rich2005 for your help!
I think I found a path to the solution but I have still a last mile to walk.
With this alternative command, I can open a new instance of Gimp if needed or stay in the opened instance:
open ~/Documents/Archive/scanpic1.jpg -a gimp <-- launch a new gimp and open the file
open ~/Documents/Archive/scanpic2.jpg -a gimp <-- open the second file in the existing gimp
There is still a bit of work that I have to do. Gimp looks like a symlink to the "old" 2.8 that's still on my system. I have to check if its really the case and then link the word "gimp" to the 2.10.8 build that I'm using since I discovered Partha Bagchi's build by reading posts in this forum! And of course I also need to check if I can integrate this in my script.
dw
Edit: it works in the script (with 2.8 for now) but I can't find how to link mcgim 2.10.8 to the alias gimp. Maybe, as 2.10 is an app which does not rely on X11 anymore (from my understanding) it has to be done some other way?