Index: scribus/main_nix.cpp
===================================================================
--- scribus/main_nix.cpp	(revision 19378)
+++ scribus/main_nix.cpp	(working copy)
@@ -39,6 +39,7 @@
 #include "scimagecachemanager.h"
 
 #include "scconfig.h"
+#include "scraction.h" // JF: need to be able to trigger action for scripter to run without GUI
 
 int mainApp(int argc, char **argv);
 void initCrashHandler();
@@ -83,7 +84,16 @@
 		int appRetVal=app.init();
 		if (appRetVal==EXIT_FAILURE)
 			return(EXIT_FAILURE);
-		return app.exec();
+		// JF: This is ugly
+		// it is this way because for now scribus use app.useGUI variable
+		// as synonym for 'run scribus with GUI or not at all'
+		if (!app.pythonScript.isNull())
+		{
+			if (ScCore->primaryMainWindow()->scrActions.contains("scripterRunPythonScript"))
+				ScCore->primaryMainWindow()->scrActions.value("scripterRunPythonScript")->trigger();
+		}
+		else
+			return app.exec();
 	}
 	return EXIT_SUCCESS;	
 }
Index: scribus/plugins/scriptplugin/scriptercore.cpp
===================================================================
--- scribus/plugins/scriptplugin/scriptercore.cpp	(revision 19378)
+++ scribus/plugins/scriptplugin/scriptercore.cpp	(working copy)
@@ -36,6 +36,7 @@
 #include "prefscontext.h"
 #include "prefstable.h"
 #include "prefsmanager.h"
+#include "scribusapp.h" // JF: need it to acces ScQApp->pythonScript
 
 ScripterCore::ScripterCore(QWidget* parent)
 {
@@ -61,6 +62,10 @@
 	QObject::connect( scrScripterActions["scripterShowConsole"], SIGNAL(toggled(bool)) , this, SLOT(slotInteractiveScript(bool)) );
 	QObject::connect( scrScripterActions["scripterAboutScript"], SIGNAL(triggered()) , this, SLOT(aboutScript()) );
 
+	// JF: Create an action that will run python file without GUI
+	ScCore->primaryMainWindow()->scrActions.insert("scripterRunPythonScript", new ScrAction(this));
+	QObject::connect( ScCore->primaryMainWindow()->scrActions.value("scripterRunPythonScript"), SIGNAL(triggered()) , this, SLOT(slotRunPythonScript()) );
+
 	SavedRecentScripts.clear();
 	ReadPlugPrefs();
 
@@ -353,6 +358,13 @@
 	enableMainWindowMenu();
 }
 
+// JF: needed for running script without GUI - this is activated by action from main_nix.cpp
+void ScripterCore::slotRunPythonScript()
+{
+	slotRunScriptFile(ScQApp->pythonScript);
+	FinishScriptRun();
+}
+
 void ScripterCore::slotRunScript(const QString Script)
 {
 	// Prevent two scripts to be run concurrently or face crash!
Index: scribus/plugins/scriptplugin/scriptercore.h
===================================================================
--- scribus/plugins/scriptplugin/scriptercore.h	(revision 19378)
+++ scribus/plugins/scriptplugin/scriptercore.h	(working copy)
@@ -39,6 +39,7 @@
 	void StdScript(QString filebasename);
 	void RecentScript(QString fn);
 	void slotRunScriptFile(QString fileName, bool inMainInterpreter = false);
+	void slotRunPythonScript(); // JF: needed for running python script without GUI
 	void slotRunScript(const QString Script);
 	void slotInteractiveScript(bool);
 	void slotExecute();
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 19378)
+++ scribus/scribus.cpp	(working copy)
@@ -347,7 +347,8 @@
 	setWindowIcon(loadIcon("AppIcon.png"));
 	setObjectName("MainWindow");
 	scrActionGroups.clear();
-	scrActions.clear();
+	// JF: DO NOT clear actions : scripter plugin has created one allready!
+//	scrActions.clear();
 	scrRecentFileActions.clear();
 	scrRecentPasteActions.clear();
 	scrWindowsActions.clear();
Index: scribus/scribusapp.cpp
===================================================================
--- scribus/scribusapp.cpp	(revision 19378)
+++ scribus/scribusapp.cpp	(working copy)
@@ -65,6 +65,7 @@
 #define ARG_SWAPDIABUTTONS "--swap-buttons"
 #define ARG_PREFS "--prefs"
 #define ARG_UPGRADECHECK "--upgradecheck"
+#define ARG_PYTHONSCRIPT "--python-script"
 #define ARG_TESTS "--tests"
 
 #define ARG_VERSION_SHORT "-v"
@@ -80,6 +81,7 @@
 #define ARG_SWAPDIABUTTONS_SHORT "-sb"
 #define ARG_PREFS_SHORT "-pr"
 #define ARG_UPGRADECHECK_SHORT "-u"
+#define ARG_PYTHONSCRIPT_SHORT "-py"
 #define ARG_TESTS_SHORT "-T"
 
 // Qt wants -display not --display or -d
@@ -252,6 +254,21 @@
 		} else if (strncmp(arg.toLocal8Bit().data(),"-psn_",4) == 0)
 		{
 			// Andreas Vox: Qt/Mac has -psn_blah flags that must be accepted.
+		} else if (arg == ARG_PYTHONSCRIPT || arg == ARG_PYTHONSCRIPT_SHORT) {
+			pythonScript = QFile::decodeName(args[i + 1].toLocal8Bit());
+			if (!QFileInfo(pythonScript).exists()) {
+				showHeader();
+				if (pythonScript.left(1) == "-" || pythonScript.left(2) == "--") {
+					std::cout << tr("Invalid argument: ").toLocal8Bit().data() << pythonScript.toLocal8Bit().data() << std::endl;
+				} else {
+					std::cout << tr("File %1 does not exist, aborting.").arg(pythonScript).toLocal8Bit().data() << std::endl;
+				}
+				showUsage();
+				useGUI=false;
+				return;
+			} else {
+				++i;
+			}
 		} else {
 			fileName = QFile::decodeName(args[i].toLocal8Bit());
 			if (!QFileInfo(fileName).exists()) {
@@ -464,8 +481,8 @@
 	printArgLine(ts, ARG_SWAPDIABUTTONS_SHORT, ARG_SWAPDIABUTTONS, tr("Use right to left dialog button ordering (eg. Cancel/No/Yes instead of Yes/No/Cancel)") );
 	printArgLine(ts, ARG_UPGRADECHECK_SHORT, ARG_UPGRADECHECK, tr("Download a file from the Scribus website and show the latest available version.") );
 	printArgLine(ts, ARG_VERSION_SHORT, ARG_VERSION, tr("Output version information and exit") );
+	printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, QString(QString(ARG_PYTHONSCRIPT) + QString(" ") + tr("filename")).toLocal8Bit().constData(), tr("Run filename in Python scripter") );
 	
-	
 #if defined(_WIN32) && !defined(_CONSOLE)
 	printArgLine(ts, ARG_CONSOLE_SHORT, ARG_CONSOLE, tr("Display a console window") );
 #endif
Index: scribus/scribusapp.h
===================================================================
--- scribus/scribusapp.h	(revision 19378)
+++ scribus/scribusapp.h	(working copy)
@@ -69,6 +69,7 @@
 		bool neverSplashExists();
 		const QString& currGUILanguage() { return GUILang; }
 		ScDLManager* dlManager() { return m_scDLMgr; }
+		QString pythonScript; // JF: script to be run in pythoun without GUI
 
 	private:
 		ScribusCore* m_ScCore;
