Revision: 28788 http://sourceforge.net/p/bibdesk/svn/28788 Author: hofman Date: 2024-02-21 11:01:35 +0000 (Wed, 21 Feb 2024) Log Message: ----------- use activateFileViewerSelectingURLs: in somemore cases
Modified Paths: -------------- trunk/bibdesk/BDSKOrphanedFilesFinder.m trunk/bibdesk/BDSKWebView.m trunk/bibdesk/BibPref_Export.m trunk/bibdesk/BibPref_TeX.m Modified: trunk/bibdesk/BDSKOrphanedFilesFinder.m =================================================================== --- trunk/bibdesk/BDSKOrphanedFilesFinder.m 2024-02-21 10:27:28 UTC (rev 28787) +++ trunk/bibdesk/BDSKOrphanedFilesFinder.m 2024-02-21 11:01:35 UTC (rev 28788) @@ -297,13 +297,14 @@ NSArray *paths = [[[arrayController arrangedObjects] objectsAtIndexes:rowIndexes] valueForKey:@"path"]; NSInteger type = ([sender isKindOfClass:[NSMenuItem class]]) ? [sender tag] : 0; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; + NSMutableArray *urls = [NSMutableArray array]; - for (NSString *path in paths) { - if(type == 1) - [ws openURLWithDefaultApp:[NSURL fileURLWithPath:path isDirectory:NO]]; - else - [ws selectFile:path inFileViewerRootedAtPath:@""]; - } + for (NSString *path in paths) + [urls addObject:[NSURL fileURLWithPath:path isDirectory:NO]]; + if(type == 1) + [ws openURLs:urls withSearchString:@""]; + else + [ws activateFileViewerSelectingURLs:urls]; } - (void)trashFiles:(NSArray *)files { Modified: trunk/bibdesk/BDSKWebView.m =================================================================== --- trunk/bibdesk/BDSKWebView.m 2024-02-21 10:27:28 UTC (rev 28787) +++ trunk/bibdesk/BDSKWebView.m 2024-02-21 11:01:35 UTC (rev 28788) @@ -199,7 +199,7 @@ - (void)revealLink:(id)sender { NSURL *linkURL = (NSURL *)[[sender representedObject] objectForKey:WebElementLinkURLKey]; if ([linkURL isFileURL]) - [[NSWorkspace sharedWorkspace] selectFile:[linkURL path] inFileViewerRootedAtPath:@""]; + [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[linkURL]]; else NSBeep(); } Modified: trunk/bibdesk/BibPref_Export.m =================================================================== --- trunk/bibdesk/BibPref_Export.m 2024-02-21 10:27:28 UTC (rev 28787) +++ trunk/bibdesk/BibPref_Export.m 2024-02-21 11:01:35 UTC (rev 28788) @@ -566,7 +566,7 @@ theURL = [[outlineView itemAtRow:row] representedFileURLNoUI]; } if (theURL) - [[NSWorkspace sharedWorkspace] selectFile:[theURL path] inFileViewerRootedAtPath:@""]; + [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[theURL]]; } - (IBAction)chooseFile:(id)sender; Modified: trunk/bibdesk/BibPref_TeX.m =================================================================== --- trunk/bibdesk/BibPref_TeX.m 2024-02-21 10:27:28 UTC (rev 28787) +++ trunk/bibdesk/BibPref_TeX.m 2024-02-21 11:01:35 UTC (rev 28788) @@ -154,7 +154,7 @@ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")]; [alert beginSheetModalForWindow:[[self view] window] completionHandler:^(NSInteger returnCode){ if(returnCode == NSAlertFirstButtonReturn) - [[NSWorkspace sharedWorkspace] selectFile:[fileURL path] inFileViewerRootedAtPath:@""]; + [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[fileURL]]; }]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit