Revision: 27231
          http://sourceforge.net/p/bibdesk/svn/27231
Author:   hofman
Date:     2022-01-17 09:58:03 +0000 (Mon, 17 Jan 2022)
Log Message:
-----------
add initial indexes between start/end to indexes for autofile and download 
command

Modified Paths:
--------------
    trunk/bibdesk/BibItem+Scripting.m

Modified: trunk/bibdesk/BibItem+Scripting.m
===================================================================
--- trunk/bibdesk/BibItem+Scripting.m   2022-01-17 09:34:39 UTC (rev 27230)
+++ trunk/bibdesk/BibItem+Scripting.m   2022-01-17 09:58:03 UTC (rev 27231)
@@ -671,10 +671,12 @@
             [command setScriptErrorString:@"Only a single linked file can be 
moved to a given location."];
             return nil;
         }
-        if (indexes)
+        if (indexes) {
+            [indexes addIndexesInRange:NSMakeRange(start, end + 1 - start)];
             linkedfiles = [linkedfiles objectsAtIndexes:indexes];
-        else if (start > 0 || end < count - 1)
+        } else if (start > 0 || end < count - 1) {
             linkedfiles = [linkedfiles subarrayWithRange:NSMakeRange(start, 
end + 1 - start)];
+        }
     }
     
     if (location) {
@@ -786,11 +788,12 @@
             [command setScriptErrorString:@"Invalid linked URL index."];
             return nil;
         }
-        if (indexes)
+        if (indexes) {
+            [indexes addIndexesInRange:NSMakeRange(start, end + 1 - start)];
             linkedURLs = [linkedURLs objectsAtIndexes:indexes];
-        else if (start > 0 || end < count - 1)
+        } else if (start > 0 || end < count - 1) {
             linkedURLs = [linkedURLs subarrayWithRange:NSMakeRange(start, end 
+ 1 - start)];
-        for (BDSKLinkedFile *linkedURL in linkedURLs) {
+        }for (BDSKLinkedFile *linkedURL in linkedURLs) {
             [self downloadLinkedFile:linkedURL replace:replace];
         }
     } else {

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