Added a field that allows the user to set sys.argv-style arguments
to the script. Fixes #757544.
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
index 7778ff0..bcdc0cd 100644
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
+++ b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
@@ -14,6 +14,7 @@
                 nosite = NSButton; 
                 optimize = NSButton; 
                 others = NSTextField; 
+                scriptargs = NSTextField; 
                 tabs = NSButton; 
                 verbose = NSButton; 
                 "with_terminal" = NSButton; 
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
index 0630cb9..e258c72 100644
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
+++ b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
@@ -3,14 +3,14 @@
 <plist version="1.0">
 <dict>
 	<key>IBDocumentLocation</key>
-	<string>551 90 356 240 0 0 1280 1002 </string>
+	<string>398 60 356 240 0 0 1024 746 </string>
 	<key>IBFramework Version</key>
-	<string>286.0</string>
+	<string>291.0</string>
 	<key>IBOpenObjects</key>
 	<array>
 		<integer>5</integer>
 	</array>
 	<key>IBSystem Version</key>
-	<string>6I32</string>
+	<string>6L60</string>
 </dict>
 </plist>
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
index 97eb230..af6decb 100644
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
+++ b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
Binary files differ
diff --git a/Mac/OSX/PythonLauncher/FileSettings.h b/Mac/OSX/PythonLauncher/FileSettings.h
index f70b05f..d807bae 100755
--- a/Mac/OSX/PythonLauncher/FileSettings.h
+++ b/Mac/OSX/PythonLauncher/FileSettings.h
@@ -19,6 +19,7 @@
 - (BOOL) tabs;
 - (NSString *) others;
 - (BOOL) with_terminal;
+- (NSString *) scriptargs;
 @end
 
 @interface FileSettings : NSObject <FileSettingsSource>
@@ -33,6 +34,7 @@
     BOOL nosite;		// -S option: don't import site.py
     BOOL tabs;			// -t option: warn about inconsistent tabs
     NSString *others;		// other options
+    NSString *scriptargs;	// script arguments (not for preferences)
     BOOL with_terminal;		// Run in terminal window
 
     FileSettings *origsource;
diff --git a/Mac/OSX/PythonLauncher/FileSettings.m b/Mac/OSX/PythonLauncher/FileSettings.m
index 7b28daa..fc3937b 100755
--- a/Mac/OSX/PythonLauncher/FileSettings.m
+++ b/Mac/OSX/PythonLauncher/FileSettings.m
@@ -77,6 +77,7 @@
     nosite = source->nosite;
     tabs = source->tabs;
     others = [source->others retain];
+    scriptargs = [source->scriptargs retain];
     with_terminal = source->with_terminal;
     prefskey = source->prefskey;
     if (prefskey) [prefskey retain];
@@ -164,6 +165,7 @@
     self = [self initWithFileSettings: fsdefaults];
     if (!self) return self;
     interpreters = [fsdefaults->interpreters retain];
+    scriptargs = [@"" retain];
     [self applyUserDefaults: filetype];
     prefskey = [filetype retain];
     return self;
@@ -191,6 +193,7 @@
     nosite = [source nosite];
     tabs = [source tabs];
     others = [[source others] retain];
+    scriptargs = [[source scriptargs] retain];
     with_terminal = [source with_terminal];
     // And if this is a user defaults object we also save the
     // values
@@ -206,6 +209,7 @@
             [NSNumber numberWithBool: nosite], @"nosite",
             [NSNumber numberWithBool: nosite], @"nosite",
             others, @"others",
+            scriptargs, @"scriptargs",
             [NSNumber numberWithBool: with_terminal], @"with_terminal",
             nil];
         defaults = [NSUserDefaults standardUserDefaults];
@@ -235,6 +239,8 @@
     if (value) tabs = [value boolValue];
     value = [dict objectForKey: @"others"];
     if (value) others = [value retain];
+    value = [dict objectForKey: @"scriptargs"];
+    if (value) scriptargs = [value retain];
     value = [dict objectForKey: @"with_terminal"];
     if (value) with_terminal = [value boolValue];
 }
@@ -260,7 +266,7 @@
         cur_interp = interpreter;
         
     return [NSString stringWithFormat:
-        @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %s",
+        @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s",
         cur_interp,
         debug?" -d":"",
         verbose?" -v":"",
@@ -270,6 +276,7 @@
         tabs?" -t":"",
         others,
         script,
+        scriptargs,
         with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
 }
 
@@ -285,6 +292,7 @@
 - (BOOL) nosite { return nosite;};
 - (BOOL) tabs { return tabs;};
 - (NSString *) others { return others;};
+- (NSString *) scriptargs { return scriptargs;};
 - (BOOL) with_terminal { return with_terminal;};
 
 @end
diff --git a/Mac/OSX/PythonLauncher/MyDocument.h b/Mac/OSX/PythonLauncher/MyDocument.h
index dd2b4fe..00c1bae 100755
--- a/Mac/OSX/PythonLauncher/MyDocument.h
+++ b/Mac/OSX/PythonLauncher/MyDocument.h
@@ -23,6 +23,7 @@
     IBOutlet NSButton *tabs;
     IBOutlet NSTextField *others;
     IBOutlet NSButton *with_terminal;
+    IBOutlet NSTextField *scriptargs;
     IBOutlet NSTextField *commandline;
 
     NSString *script;
diff --git a/Mac/OSX/PythonLauncher/MyDocument.m b/Mac/OSX/PythonLauncher/MyDocument.m
index 09a0024..5acc2dc 100755
--- a/Mac/OSX/PythonLauncher/MyDocument.m
+++ b/Mac/OSX/PythonLauncher/MyDocument.m
@@ -60,6 +60,7 @@
     [nosite setState: [settings nosite]];
     [tabs setState: [settings tabs]];
     [others setStringValue: [settings others]];
+    [scriptargs setStringValue: [settings scriptargs]];
     [with_terminal setState: [settings with_terminal]];
     
     [commandline setStringValue: [settings commandLineForScript: script]];
@@ -161,6 +162,7 @@
 - (BOOL) nosite { return [nosite state];};
 - (BOOL) tabs { return [tabs state];};
 - (NSString *) others { return [others stringValue];};
+- (NSString *) scriptargs { return [scriptargs stringValue];};
 - (BOOL) with_terminal { return [with_terminal state];};
 
 // Delegates
diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.m b/Mac/OSX/PythonLauncher/PreferencesWindowController.m
index fd65194..5dd08f3 100644
--- a/Mac/OSX/PythonLauncher/PreferencesWindowController.m
+++ b/Mac/OSX/PythonLauncher/PreferencesWindowController.m
@@ -39,6 +39,7 @@
     [tabs setState: [settings tabs]];
     [others setStringValue: [settings others]];
     [with_terminal setState: [settings with_terminal]];
+    // Not scriptargs, it isn't for preferences
     
     [commandline setStringValue: [settings commandLineForScript: @"<your script here>"]];
 }
@@ -84,6 +85,7 @@
 - (BOOL) tabs { return [tabs state];};
 - (NSString *) others { return [others stringValue];};
 - (BOOL) with_terminal { return [with_terminal state];};
+- (NSString *) scriptargs { return @"";};
 
 // Delegates
 - (void)controlTextDidChange:(NSNotification *)aNotification
diff --git a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj
index 107ce3d..badee87 100755
--- a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj
+++ b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj
@@ -132,6 +132,7 @@
 				4A9504D0FFE6A4CB11CA0CBA,
 				4A9504D1FFE6A4CB11CA0CBA,
 			);
+			hasScannedForEncodings = 1;
 			isa = PBXProject;
 			mainGroup = 2A37F4AAFDCFA73011CA2CEA;
 			projectDirPath = "";
@@ -385,7 +386,6 @@
 </dict>
 </plist>
 ";
-			shouldUseHeadermap = 0;
 		};
 		2A37F4C7FDCFA73011CA2CEA = {
 			buildActionMask = 2147483647;