Revision: 12275
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12275&view=rev
Author: hofman
Date: 2008-01-05 09:56:33 -0800 (Sat, 05 Jan 2008)
Log Message:
-----------
Make editors accessible to AppleScript.
Modified Paths:
--------------
trunk/bibdesk/BibDocument+Scripting.m
trunk/bibdesk/Scripting/BibDesk.sdef
Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m 2008-01-05 17:41:32 UTC (rev
12274)
+++ trunk/bibdesk/BibDocument+Scripting.m 2008-01-05 17:56:33 UTC (rev
12275)
@@ -195,11 +195,12 @@
// instead of trying to do string comparisons
BibAuthor *newAuth = [BibAuthor authorWithName:name andPub:nil];
- NSEnumerator *pubEnum = [publications objectEnumerator];
+ NSEnumerator *pubEnum;
NSEnumerator *authEnum;
BibItem *pub;
BibAuthor *auth;
+ pubEnum = [publications objectEnumerator];
while (pub = [pubEnum nextObject]) {
authEnum = [[pub pubAuthors] objectEnumerator];
while (auth = [authEnum nextObject]) {
@@ -208,6 +209,17 @@
}
}
}
+
+ pubEnum = [publications objectEnumerator];
+ while (pub = [pubEnum nextObject]) {
+ authEnum = [[pub pubEditors] objectEnumerator];
+ while (auth = [authEnum nextObject]) {
+ if ([auth isEqual:newAuth]) {
+ return auth;
+ }
+ }
+ }
+
return nil;
}
Modified: trunk/bibdesk/Scripting/BibDesk.sdef
===================================================================
--- trunk/bibdesk/Scripting/BibDesk.sdef 2008-01-05 17:41:32 UTC (rev
12274)
+++ trunk/bibdesk/Scripting/BibDesk.sdef 2008-01-05 17:56:33 UTC (rev
12275)
@@ -632,6 +632,10 @@
description="Authors of the publication.">
<cocoa key="pubAuthors"/>
</element>
+ <element type="editor" name="editor"
+ description="Editors of the publication.">
+ <cocoa key="pubEditors"/>
+ </element>
<element type="field"
description="The fields of the publication. These should be
accessed by name.">
<cocoa key="bibFields"/>
@@ -781,6 +785,11 @@
</responds-to>
</class>
+ <class name="editor" plural="editors" code="edtr" inherits="author"
+ description="Contains the name of an editor. Editors
are authors.">
+ <cocoa class="BibAuthor"/>
+ </class>
+
<class name="macro" plural="macros" code="bmcr" inherits="item"
description="A macro of a document or a global macro.">
<cocoa class="BDSKMacro"/>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit