Revision: 29003
http://sourceforge.net/p/bibdesk/svn/29003
Author: hofman
Date: 2025-02-16 09:27:50 +0000 (Sun, 16 Feb 2025)
Log Message:
-----------
resolve relative path relative to document subject of command when missing
Modified Paths:
--------------
trunk/bibdesk/BDSKResolveCommand.m
Modified: trunk/bibdesk/BDSKResolveCommand.m
===================================================================
--- trunk/bibdesk/BDSKResolveCommand.m 2025-02-13 16:54:18 UTC (rev 29002)
+++ trunk/bibdesk/BDSKResolveCommand.m 2025-02-16 09:27:50 UTC (rev 29003)
@@ -38,6 +38,7 @@
#import "BDSKResolveCommand.h"
#import "NSString_BDSKExtensions.h"
+#import "NSScriptCommand_BDSKExtensions.h"
@implementation BDSKResolveCommand
@@ -58,8 +59,13 @@
if ([pathOrURL isAbsolutePath])
return [NSURL fileURLWithPath:pathOrURL isDirectory:NO];
if (baseURL == nil) {
- [self setScriptErrorNumber:NSRequiredArgumentsMissingScriptError];
- return nil;
+ id subject = [[self subjectSpecifier] objectsByEvaluatingSpecifier];
+ if ([subject isKindOfClass:[NSDocument class]])
+ baseURL = [subject fileURL];
+ if (baseURL == nil) {
+ [self setScriptErrorNumber:NSRequiredArgumentsMissingScriptError];
+ return nil;
+ }
}
BOOL isDir = YES;
baseURL = [baseURL URLByStandardizingPath];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit