Revision: 23938
          http://sourceforge.net/p/bibdesk/svn/23938
Author:   hofman
Date:     2019-07-03 21:41:07 +0000 (Wed, 03 Jul 2019)
Log Message:
-----------
Add a script command to download a linked URL or a URL field

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/BibItem.h
    trunk/bibdesk/BibItem.m
    trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
    trunk/bibdesk/Scripting/BibDesk.sdef

Added Paths:
-----------
    trunk/bibdesk/BDSKDownloadCommand.h
    trunk/bibdesk/BDSKDownloadCommand.m

Added: trunk/bibdesk/BDSKDownloadCommand.h
===================================================================
--- trunk/bibdesk/BDSKDownloadCommand.h                         (rev 0)
+++ trunk/bibdesk/BDSKDownloadCommand.h 2019-07-03 21:41:07 UTC (rev 23938)
@@ -0,0 +1,42 @@
+//
+//  BDSKDownloadCommand.h
+//  BibDesk
+//
+//  Created by Christiaan Hofman on 03/07/2019.
+/*
+ This software is Copyright (c) 2019
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface BDSKDownloadCommand : NSScriptCommand
+@end

Added: trunk/bibdesk/BDSKDownloadCommand.m
===================================================================
--- trunk/bibdesk/BDSKDownloadCommand.m                         (rev 0)
+++ trunk/bibdesk/BDSKDownloadCommand.m 2019-07-03 21:41:07 UTC (rev 23938)
@@ -0,0 +1,175 @@
+//
+//  BDSKDownloadCommand.m
+//  BibDesk
+//
+//  Created by Christiaan Hofman on 03/07/2019.
+/*
+ This software is Copyright (c) 2019
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "BDSKDownloadCommand.h"
+#import "BDSKStringConstants.h"
+#import "BibItem.h"
+#import "BibDocument.h"
+#import "BDSKLinkedFile.h"
+#import "BDSKOwnerProtocol.h"
+#import "BDSKTypeManager.h"
+
+@implementation BDSKDownloadCommand
+
+- (id)performDefaultImplementation {
+    NSScriptObjectSpecifier *receiverSpec = [self receiversSpecifier];
+    NSString *receiverClass = [[receiverSpec keyClassDescription] className];
+    NSDictionary *params = [self evaluatedArguments];
+    BOOL replace = [[params objectForKey:@"replace"] boolValue];
+    BibItem *pub = nil;
+    NSString *field = nil;
+    NSInteger start = 0, end = 0;
+    NSMutableIndexSet *indexes = nil;
+    NSArray *linkedURLs = nil;
+    
+    if ([receiverClass isEqualToString:@"publication"]) {
+        pub = [self evaluatedReceivers];
+        if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKUseLocalUrlAndUrlKey])
+            field = BDSKUrlString;
+        else
+            field = BDSKRemoteURLString;
+    } else if ([receiverClass isEqualToString:@"field"]) {
+        pub = [[receiverSpec containerSpecifier] objectsByEvaluatingSpecifier];
+        field = [[(NSNameSpecifier *)receiverSpec name] fieldName];
+        if ([field isRemoteURLField] == NO) {
+            [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+            [self setScriptErrorString:@"Field must be a remote URL field."];
+            return nil;
+        }
+    } else if ([receiverClass isEqualToString:@"linked file"]) {
+        field = BDSKRemoteURLString;
+        if ([[receiverSpec key] isEqualToString:@""]) {
+            // this is an 'item i of linked URL' specifier
+            // -indicesOfObjectsByEvaluatingWithContainer:count: does not work 
here
+            if ([receiverSpec isKindOfClass:[NSIndexSpecifier class]] == NO ||
+                [[receiverSpec containerSpecifier] 
isKindOfClass:[NSPropertySpecifier class]] == NO) {
+                [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+                [self setScriptErrorString:@"Do not understand linked URL 
specifier."];
+                return nil;
+            }
+            pub = [[[receiverSpec containerSpecifier] containerSpecifier] 
objectsByEvaluatingSpecifier];
+            end = start = [(NSIndexSpecifier *)receiverSpec index];
+        } else {
+            pub = [[receiverSpec containerSpecifier] 
objectsByEvaluatingSpecifier];
+            // NSPropertySpecifier, NSIndexSpecifier, NSRangeSpecifier, 
NSMiddleSpecifier, NSWhoseSpecifier
+            NSInteger i, count = -2;
+            NSInteger *indices = [receiverSpec 
indicesOfObjectsByEvaluatingWithContainer:pub count:&count];
+            if (count < -1) {
+                [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+                [self setScriptErrorString:@"Do not understand linked URL 
specifier."];
+                return nil;
+            }
+            if (count == 0) {
+                return nil;
+            } else if (count == -1) {
+                start = 0;
+                end = -1;
+            } else {
+                end = start = indices[0];
+                for (i = 1; i < count; i++) {
+                    if (indices[i] = end + 1) {
+                        end++;
+                    } else {
+                        // not a single range, use an index set, start/end 
only holds the first range
+                        if (indexes == nil)
+                            indexes = [NSMutableIndexSet 
indexSetWithIndexesInRange:NSMakeRange(start, end + 1 - start)];
+                        [indexes addIndex:indices[i]];
+                    }
+                }
+            }
+        }
+    } else {
+        [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+        [self setScriptErrorString:@"Receiver should be a publication, field, 
or linked URL(s)."];
+        [self setScriptErrorOffendingObjectDescriptor:[receiverSpec 
descriptor]];
+        return nil;
+    }
+    
+    if (pub == nil) {
+        [self setScriptErrorNumber:NSRequiredArgumentsMissingScriptError];
+        [self setScriptErrorString:@"Could not find a publication for which to 
download."];
+        return nil;
+    }
+    if ([pub isKindOfClass:[BibItem class]] == NO) {
+        [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+        [self setScriptErrorString:@"Receiver is not a publication."];
+        return nil;
+    }
+    
+    BibDocument *doc = (BibDocument *)[pub owner];
+
+    if ([doc isDocument] == NO) {
+        [self setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
+        [self setScriptErrorString:@"Cannot download for external items."];
+        return nil;
+    }
+    
+    if ([field isEqualToString:BDSKRemoteURLString]) {
+        linkedURLs = [pub remoteURLs];
+        NSInteger count = [linkedURLs count];
+        if (count == 0)
+            return nil;
+        if (start < 0)
+            start += count;
+        if (end < 0)
+            end += count;
+        if (start < 0 || end < 0 || start >= count || end >= count || end < 
start || (NSInteger)[indexes lastIndex] >= count) {
+            [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+            [self setScriptErrorString:@"Invalid linked URL index."];
+            return nil;
+        }
+        if (indexes)
+            linkedURLs = [linkedURLs objectsAtIndexes:indexes];
+        else if (start > 0 || end < count - 1)
+            linkedURLs = [linkedURLs subarrayWithRange:NSMakeRange(start, end 
+ 1 - start)];
+        for (BDSKLinkedFile *linkedURL in linkedURLs) {
+            [pub downloadLinkedFile:linkedURL replace:replace];
+        }
+    } else {
+        if ([pub remoteURLForField:field] == nil) {
+            [self setScriptErrorNumber:NSArgumentsWrongScriptError];
+            [self setScriptErrorString:@"Invalid remote URL field."];
+            return nil;
+        }
+        [pub downloadURLForField:field];
+    }
+    
+    return nil;
+}
+
+@end

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2019-07-03 17:52:39 UTC (rev 23937)
+++ trunk/bibdesk/BDSKEditor.m  2019-07-03 21:41:07 UTC (rev 23938)
@@ -557,8 +557,8 @@
 
 - (IBAction)downloadLinkedURL:(id)sender{
     if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKUseLocalUrlAndUrlKey]) {
-        if ([publication canDownloadUrl])
-            [publication downloadUrl];
+        if ([publication canDownloadURLForField:BDSKUrlString])
+            [publication downloadURLForField:BDSKUrlString];
     } else {
         for (BDSKLinkedFile *file in [publication remoteURLs]) {
             if ([publication canDownloadLinkedFile:file])
@@ -1598,7 +1598,7 @@
        }
     else if (theAction == @selector(downloadLinkedURL:)) {
         if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKUseLocalUrlAndUrlKey]) {
-            return [publication canDownloadUrl];
+            return [publication canDownloadURLForField:BDSKUrlString];
         } else {
             for (BDSKLinkedFile *file in [publication remoteURLs]) {
                 if ([publication canDownloadLinkedFile:file])

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2019-07-03 17:52:39 UTC (rev 23937)
+++ trunk/bibdesk/BibDocument.m 2019-07-03 21:41:07 UTC (rev 23938)
@@ -2122,8 +2122,8 @@
         NSArray *types = [[NSUserDefaults standardUserDefaults] 
stringArrayForKey:BDSKURLTypesToDownloadKey];
         for (pub in newPubs) {
             if (useLocalUrlAndUrl) {
-                if ([pub canDownloadUrl] && [types containsObject:[[[pub 
remoteURLForField:BDSKUrlString] pathExtension] lowercaseString] ?: @""])
-                    [pub downloadUrl];
+                if ([pub canDownloadURLForField:BDSKUrlString] && [types 
containsObject:[[[pub remoteURLForField:BDSKUrlString] pathExtension] 
lowercaseString] ?: @""])
+                    [pub downloadURLForField:BDSKUrlString];
             } else if ([[pub localFiles] count] == 0) {
                 for (BDSKLinkedFile *linkedURL in [pub remoteURLs]) {
                     if ([pub canDownloadLinkedFile:linkedURL] &&

Modified: trunk/bibdesk/BibItem.h
===================================================================
--- trunk/bibdesk/BibItem.h     2019-07-03 17:52:39 UTC (rev 23937)
+++ trunk/bibdesk/BibItem.h     2019-07-03 21:41:07 UTC (rev 23938)
@@ -822,10 +822,10 @@
 - (id<BDSKItemProgressDelegate>)progressDelegate;
 - (void)setProgressDelegate:(id<BDSKItemProgressDelegate>)delegate;
 
-- (void)downloadUrl;
+- (void)downloadURLForField:(NSString *)field;
 - (void)downloadLinkedFile:(BDSKLinkedFile *)linkedFile replace:(BOOL)replace;
 
-- (BOOL)canDownloadUrl;
+- (BOOL)canDownloadURLForField:(NSString *)field;
 - (BOOL)canDownloadLinkedFile:(BDSKLinkedFile *)linkedFile;
 
 - (void)customFieldsDidChange:(NSNotification *)aNotification;

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2019-07-03 17:52:39 UTC (rev 23937)
+++ trunk/bibdesk/BibItem.m     2019-07-03 21:41:07 UTC (rev 23938)
@@ -3242,9 +3242,9 @@
     [downloads removeObject:download];
 }
 
-- (void)downloadUrl {
-    NSURL *url = [self remoteURLForField:BDSKUrlString];
-    if (url) {
+- (void)downloadURLForField:(NSString *)field {
+    NSURL *url = [self remoteURLForField:field];
+    if (url && [[downloads valueForKey:@"URL"] containsObject:url] == NO) {
         BDSKItemDownload *download = [[BDSKItemDownload alloc] 
initWithURL:url];
         if (downloads == nil)
             downloads = [[NSMutableArray alloc] init];
@@ -3257,7 +3257,7 @@
 
 - (void)downloadLinkedFile:(BDSKLinkedFile *)linkedFile replace:(BOOL)replace {
     NSUInteger idx = [files indexOfObject:linkedFile];
-    if ([linkedFile isFile] == NO && idx != NSNotFound) {
+    if ([linkedFile isFile] == NO && idx != NSNotFound && [[downloads 
valueForKey:@"URL"] containsObject:[linkedFile URL]] == NO) {
         BDSKItemDownload *download = [[BDSKItemDownload alloc] 
initWithLinkedFile:linkedFile atIndex:idx replace:replace];
         if (downloads == nil)
             downloads = [[NSMutableArray alloc] init];
@@ -3277,9 +3277,10 @@
     return YES;
 }
 
-- (BOOL)canDownloadUrl {
-    return [self remoteURLForField:BDSKUrlString] != nil &&
-            [NSString isEmptyString:[self valueOfField:BDSKLocalUrlString 
inherit:NO]];
+- (BOOL)canDownloadURLForField:(NSString *)field {
+    if ([[self owner] isDocument] == NO || [self remoteURLForField:field] == 
nil)
+        return NO;
+    return [NSString isEmptyString:[self valueOfField:BDSKLocalUrlString 
inherit:NO]];
 }
 
 #pragma mark -

Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===================================================================
--- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2019-07-03 17:52:39 UTC 
(rev 23937)
+++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2019-07-03 21:41:07 UTC 
(rev 23938)
@@ -476,6 +476,8 @@
                CE4385E90BB81D0500A56987 /* BDSKSearchBookmarkController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE4385E70BB81D0500A56987 /* 
BDSKSearchBookmarkController.m */; };
                CE4476DC2128907100DF38E1 /* DOMNode_BDSKExtensions.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CE4476DA2128907100DF38E1 /* 
DOMNode_BDSKExtensions.m */; };
                CE4A0E141115ABEF000A95C5 /* BDSKServiceProvider.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE4A0E121115ABEF000A95C5 /* 
BDSKServiceProvider.m */; };
+               CE51616C22CD4E7D00832F3E /* BDSKDownloadCommand.h in Headers */ 
= {isa = PBXBuildFile; fileRef = CE51616A22CD4E7D00832F3E /* 
BDSKDownloadCommand.h */; };
+               CE51616D22CD4E7D00832F3E /* BDSKDownloadCommand.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE51616B22CD4E7D00832F3E /* 
BDSKDownloadCommand.m */; };
                CE51922109E5755600E97C3A /* BDSKFindFieldEditor.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE51921F09E5755600E97C3A /* 
BDSKFindFieldEditor.m */; };
                CE522F761D5CA7FE00348D7D /* BDSKDOIParser.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE522F741D5CA7FE00348D7D /* BDSKDOIParser.m */; 
};
                CE564D260AECBA5B002F0A24 /* NSScanner_BDSKExtensions.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE564D240AECBA5B002F0A24 /* 
NSScanner_BDSKExtensions.m */; };
@@ -1435,6 +1437,8 @@
                CE452AC00F1EBBD500DA1A5A /* TestBDSKRISParser.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
TestBDSKRISParser.h; sourceTree = "<group>"; };
                CE4A0E111115ABEF000A95C5 /* BDSKServiceProvider.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
BDSKServiceProvider.h; sourceTree = "<group>"; };
                CE4A0E121115ABEF000A95C5 /* BDSKServiceProvider.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= BDSKServiceProvider.m; sourceTree = "<group>"; };
+               CE51616A22CD4E7D00832F3E /* BDSKDownloadCommand.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
BDSKDownloadCommand.h; sourceTree = "<group>"; };
+               CE51616B22CD4E7D00832F3E /* BDSKDownloadCommand.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
BDSKDownloadCommand.m; sourceTree = "<group>"; };
                CE51921E09E5755600E97C3A /* BDSKFindFieldEditor.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
BDSKFindFieldEditor.h; sourceTree = "<group>"; };
                CE51921F09E5755600E97C3A /* BDSKFindFieldEditor.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= BDSKFindFieldEditor.m; sourceTree = "<group>"; };
                CE522F731D5CA7FD00348D7D /* BDSKDOIParser.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
BDSKDOIParser.h; sourceTree = "<group>"; };
@@ -2362,6 +2366,7 @@
                                F9022FBF07580B9400C3F701 /* BibDesk.sdef */,
                                CE3011A10D5CC41D00C0B7FA /* BDSKAddCommand.m */,
                                CEDD188B21696373000E28D7 /* 
BDSKAutoFileCommand.m */,
+                               CE51616B22CD4E7D00832F3E /* 
BDSKDownloadCommand.m */,
                                CED65DC70907A2FD003EED90 /* 
BDSKParseFormatCommand.m */,
                                CE3011AB0D5CC46F00C0B7FA /* BDSKRemoveCommand.m 
*/,
                                CED876D8216D09EB0005FF8D /* 
BDSKResolveCommand.m */,
@@ -2978,6 +2983,7 @@
                                F990C5890D42D58D00B5425E /* 
BDSKDocumentSearch.h */,
                                CE522F731D5CA7FD00348D7D /* BDSKDOIParser.h */,
                                CE7B88902045664200D6A648 /* BDSKDOIWebParser.h 
*/,
+                               CE51616A22CD4E7D00832F3E /* 
BDSKDownloadCommand.h */,
                                CE6958F4223A9B94001239A6 /* BDSKDownloader.h */,
                                CE69590D223A9BBE001239A6 /* 
BDSKDownloaderDeprecated.h */,
                                CE695911223A9BD9001239A6 /* 
BDSKDownloaderSession.h */,
@@ -3386,6 +3392,7 @@
                                CE2A0A6622459A0A00A8F31C /* 
BDSKSearchForCommand.h in Headers */,
                                CE2A09D7224599B300A8F31C /* BDSKCondition.h in 
Headers */,
                                CE2A0A9122459A3600A8F31C /* BDSKTreeNode.h in 
Headers */,
+                               CE51616C22CD4E7D00832F3E /* 
BDSKDownloadCommand.h in Headers */,
                                CE2A09F7224599E100A8F31C /* 
BDSKFieldNameFormatter.h in Headers */,
                                CE2A09F0224599DB00A8F31C /* BDSKErrorObject.h 
in Headers */,
                                CE2A0A7122459A0A00A8F31C /* 
BDSKSharingBrowser.h in Headers */,
@@ -4360,6 +4367,7 @@
                                CE22E1CE0A8CCF9D002CEFB8 /* 
BDSKOrphanedFilesFinder.m in Sources */,
                                CE35DCEA0A99B1A700029B66 /* BDSKErrorEditor.m 
in Sources */,
                                CE15C0D80AA5B9A3002C555F /* BDSKErrorManager.m 
in Sources */,
+                               CE51616D22CD4E7D00832F3E /* 
BDSKDownloadCommand.m in Sources */,
                                CE7EA95D0AAC55B2000FE8FD /* 
NSWindowController_BDSKExtensions.m in Sources */,
                                F96F11970AAF4FD100815D06 /* 
NSData_BDSKExtensions.m in Sources */,
                                F90C64070AC62B7B008B2DDA /* 
BDSKShellCommandFormatter.m in Sources */,

Modified: trunk/bibdesk/Scripting/BibDesk.sdef
===================================================================
--- trunk/bibdesk/Scripting/BibDesk.sdef        2019-07-03 17:52:39 UTC (rev 
23937)
+++ trunk/bibdesk/Scripting/BibDesk.sdef        2019-07-03 21:41:07 UTC (rev 
23938)
@@ -726,6 +726,17 @@
             </result>
         </command>    
         
+        <command name="download" code="BDSKDnld"
+            description="Download a linked URL or URL field.">
+            <cocoa class="BDSKDownloadCommand"/>
+            <direct-parameter type="specifier"
+                description="A reference to a publication, linked URL(s), or 
field to download. For a publication, either linked URL(s) or a remote URL 
field are downloaded, depending on your Fields preferences."/>
+            <parameter name="replace" type="boolean" code="Repl" optional="yes"
+                description="Whether the downloaded file should replace the 
linked URL. Ignored for a field. Defaults to false.">
+                <cocoa key="replace"/>
+            </parameter>
+        </command>
+        
         <command name="rich text for" code="BDSKRICt"
                        description="Convert raw RTF data to rich text.">
             <cocoa class="BDSKRichTextForCommand"/>
@@ -1155,6 +1166,9 @@
             <responds-to name="auto file">
                 <cocoa method=""/>
             </responds-to>
+            <responds-to name="download">
+                <cocoa method=""/>
+            </responds-to>
         </class>
         
         <class name="author" plural="authors" code="auth"
@@ -1281,6 +1295,9 @@
             <responds-to name="auto file">
                 <cocoa method=""/>
             </responds-to>
+            <responds-to name="download">
+                <cocoa method=""/>
+            </responds-to>
         </class>
         
         <class name="info" plural="infos" code="Info"
@@ -1306,6 +1323,9 @@
             <responds-to name="remove">
                 <cocoa method=""/>
             </responds-to>
+            <responds-to name="download">
+                <cocoa method=""/>
+            </responds-to>
             <responds-to name="resolve" hidden="yes">
                 <cocoa method=""/>
             </responds-to>

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

Reply via email to