@@ -176,7 +176,6 @@ - (void)awakeFromNib {
176176 forEventClass: kInternetEventClass
177177 andEventID: kAEGetURL ];
178178
179-
180179 // Listen for terminate notification
181180 NSString *notificationName = NSTaskDidTerminateNotification ;
182181 if (execStyle == PlatypusExecStyle_Authenticated) {
@@ -365,17 +364,17 @@ - (void)loadAppSettings {
365364 if (acceptsFiles || acceptsText) {
366365 isDroppable = TRUE ;
367366 }
368-
367+
369368 acceptAnyDroppedItem = NO ;
370369 acceptDroppedFolders = NO ;
371-
370+
372371 // If app is droppable, the AppSettings.plist contains list of accepted file types / suffixes
373372 // We use them later as a criterion for drop acceptance
374373 if (acceptsFiles) {
375374 // Get list of accepted suffixes
376375 droppableSuffixes = [NSArray array ];
377376 droppableUniformTypes = [NSArray array ];
378-
377+
379378 if (appSettings[AppSpecKey_Suffixes]) {
380379 droppableSuffixes = [appSettings[AppSpecKey_Suffixes] copy ];
381380 }
@@ -460,7 +459,7 @@ - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentN
460459- (void )application : (NSApplication *)theApplication openFiles : (NSArray *)filenames {
461460 DLog (@" Received openFiles event for files: %@ " , [filenames description ]);
462461
463- if (hasTaskRun == FALSE && commandLineArguments != nil ) {
462+ if (hasTaskRun == NO && commandLineArguments != nil ) {
464463 for (NSString *filePath in filenames) {
465464 if ([commandLineArguments containsObject: filePath]) {
466465 return ;
@@ -530,7 +529,6 @@ - (void)windowWillClose:(NSNotification *)notification {
530529
531530// Set up any menu items, windows, controls at application launch
532531- (void )initialiseInterface {
533-
534532 // Put application name into the relevant menu items
535533 [quitMenuItem setTitle: [NSString stringWithFormat: @" Quit %@ " , appName]];
536534 [aboutMenuItem setTitle: [NSString stringWithFormat: @" About %@ " , appName]];
@@ -551,8 +549,8 @@ - (void)initialiseInterface {
551549 // Script output will be dumped in outputTextView
552550 // By default this is the Text Window text view
553551 outputTextView = textWindowTextView;
554-
555- if (runInBackground == TRUE ) {
552+
553+ if (runInBackground == YES ) {
556554 // Old Carbon way
557555// ProcessSerialNumber process;
558556// GetCurrentProcess(&process);
@@ -746,13 +744,11 @@ - (void)prepareInterfaceForExecution {
746744 [dropletMessageTextField setStringValue: @" Processing..." ];
747745 }
748746 break ;
749-
750747 }
751748}
752749
753750// Adjust controls, windows, etc. once script is done executing
754751- (void )cleanupInterface {
755-
756752 // if there are any remnants, we append them to output
757753 if (remnants != nil ) {
758754 [self appendString: remnants];
@@ -767,7 +763,7 @@ - (void)cleanupInterface {
767763
768764 }
769765 break ;
770-
766+
771767 case PlatypusInterfaceType_TextWindow:
772768 {
773769 // Update controls for text window
@@ -822,7 +818,6 @@ - (void)cleanupInterface {
822818
823819// Construct arguments list etc. before actually running the script
824820- (void )prepareForExecution {
825-
826821 // Clear arguments list and reconstruct it
827822 [arguments removeAllObjects ];
828823
@@ -849,7 +844,7 @@ - (void)prepareForExecution {
849844 // Finally, dequeue job and add arguments
850845 if ([jobQueue count ] > 0 ) {
851846 SEJob *job = jobQueue[0 ];
852-
847+
853848 // We have files in the queue, to append as arguments
854849 // We take the first job's arguments and put them into the arg list
855850 if ([job arguments ]) {
@@ -884,7 +879,6 @@ - (void)executeScript {
884879}
885880
886881- (NSString *)executeScriptForStatusMenu {
887-
888882 [self prepareForExecution ];
889883 [self prepareInterfaceForExecution ];
890884
@@ -893,7 +887,7 @@ - (NSString *)executeScriptForStatusMenu {
893887 [task setLaunchPath: interpreterPath];
894888 [task setCurrentDirectoryPath: [[NSBundle mainBundle ] resourcePath ]];
895889 [task setArguments: arguments];
896-
890+
897891 outputPipe = [NSPipe pipe ];
898892 [task setStandardOutput: outputPipe];
899893 [task setStandardError: outputPipe];
@@ -911,7 +905,6 @@ - (NSString *)executeScriptForStatusMenu {
911905
912906// Launch regular user-privileged process using NSTask
913907- (void )executeScriptWithoutPrivileges {
914-
915908 // Create task and apply settings
916909 task = [[NSTask alloc ] init ];
917910 [task setLaunchPath: interpreterPath];
@@ -1200,7 +1193,7 @@ - (void)clearOutputBuffer {
12001193
12011194- (void )appendString : (NSString *)string {
12021195 DLog (@" Appending output: \" %@ \" " , string);
1203-
1196+
12041197 if (interfaceType == PlatypusInterfaceType_None) {
12051198 fprintf (stderr, " %s \n " , [string cStringUsingEncoding: DEFAULT_TEXT_ENCODING]);
12061199 return ;
@@ -1222,7 +1215,6 @@ - (void)appendString:(NSString *)string {
12221215
12231216// Run open panel, made available to apps that accept files
12241217- (IBAction )openFiles : (id )sender {
1225-
12261218 // Create open panel
12271219 NSOpenPanel *oPanel = [NSOpenPanel openPanel ];
12281220 [oPanel setAllowsMultipleSelection: YES ];
@@ -1320,7 +1312,6 @@ - (IBAction)saveToFile:(id)sender {
13201312}
13211313
13221314- (BOOL )validateMenuItem : (NSMenuItem *)anItem {
1323-
13241315 // Status item menus are always enabled
13251316 if (interfaceType == PlatypusInterfaceType_StatusMenu) {
13261317 return YES ;
@@ -1486,7 +1477,6 @@ - (BOOL)addMenuItemSelectedJob:(NSString *)menuItemTitle {
14861477 *********************************************/
14871478
14881479- (BOOL )isAcceptableFileType : (NSString *)file {
1489-
14901480 // Check if it's a folder. If so, we only accept it if folders are accepted
14911481 BOOL isDir;
14921482 BOOL exists = [FILEMGR fileExistsAtPath: file isDirectory: &isDir];
@@ -1659,7 +1649,6 @@ - (NSImage *)imageForMenuItemFromString:(NSString *)str {
16591649 **************************************************/
16601650
16611651- (void )menuNeedsUpdate : (NSMenu *)menu {
1662-
16631652 // Run script and wait until we've received all output
16641653 NSString *outputStr = [self executeScriptForStatusMenu ];
16651654
0 commit comments