Index: trunk/src/tmcsim/simulationmanager/SimulationManager.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/SimulationManager.java	(revision 47)
+++ trunk/src/tmcsim/simulationmanager/SimulationManager.java	(revision 382)
@@ -215,9 +215,28 @@
             System.setProperty("CONFIG_DIR", "config");
         }
-
+        SimulationManager app;
         try
         {
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-            new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME);
+            app = new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME);
+            // Check if a script filename has been given as an argument
+            String arg1;
+            if (args.length > 0)
+            {
+                arg1 = args[0];
+                File scriptFile = new File("scripts"+ System.getProperty("file.separator") + arg1);
+                if (scriptFile.exists())
+                {
+                    app.loadScript(scriptFile);
+                    simManLogger.logp(Level.INFO,"SimulationManager","Main",
+                            "Sim Mgr starting with script file: " + arg1 + ".");
+                }
+                else
+                {
+                    simManLogger.logp(Level.INFO,"SimulationManager","Main",
+                            "Script file not found: " + arg1 +
+                            ". Starting with no script.");
+                }
+            }
         } catch (Exception e)
         {
@@ -230,5 +249,4 @@
             System.exit(-1);
         }
-
     }
 }
