Gimp-Forum.net
Gimp Python script file load question - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Gimp Python script file load question (/Thread-Gimp-Python-script-file-load-question)

Pages: 1 2


RE: Gimp Python script file load question - TimorousMe - 03-21-2021

(03-20-2021, 12:47 AM)Ofnuts Wrote:
Code:
OAFE.open_add_flatten_export("/Users/TimB/Desktop/xcftemplate.xcf" "/Users/TimB/Desktop/jpg_to_add.jpg" "2060" "410" "/Users/TimB/desktop")

This is indeed a single argument. If you want several arguments, you have to use commas (remember that everything between the single quotes is actually python source code, not shell code. Also if you put quotes around your number, they will be string args. Without quotes, they are likely to be the integers you need.

Code:
OAFE.open_add_flatten_export("/Users/TimB/Desktop/xcftemplate.xcf", "/Users/TimB/Desktop/jpg_to_add.jpg", 2060, 410, "/Users/TimB/desktop")

Great advice again. No quotes around the integers. This ended up working:

gimp -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import OAFE_PARAM;OAFE_PARAM.open_add_flatten_export('/Users/TimB/Desktop/xcftemplate.xcf', '/Users/TimB/Desktop/jpg_to_add.jpg', 2060, 410, '/Users/TimB/Desktop/')" -b "pdb.gimp_quit(1)"

Thank you!