Revision: 5128
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5128&view=rev
Author:   hofman
Date:     2009-01-17 22:29:12 +0000 (Sat, 17 Jan 2009)

Log Message:
-----------
return text from "get text for" script command, as rich text cannot be returned 
from a command anyway

Modified Paths:
--------------
    trunk/SKTextCommand.m
    trunk/Skim.sdef

Modified: trunk/SKTextCommand.m
===================================================================
--- trunk/SKTextCommand.m       2009-01-17 16:16:25 UTC (rev 5127)
+++ trunk/SKTextCommand.m       2009-01-17 22:29:12 UTC (rev 5128)
@@ -53,22 +53,21 @@
     
     NSDictionary *args = [self evaluatedArguments];
     PDFPage *page = [args objectForKey:@"Page"];
-    NSTextStorage *textStorage = nil;
-    NSAttributedString *attrString = nil;
+    NSString *string = nil;
     
     if ([dPO isKindOfClass:[SKPDFDocument class]]) {
-        attrString = page ? [page attributedString] : [[[dPO pdfDocument] 
selectionForEntireDocument] attributedString];
+        string = page ? [page string] : [[dPO pdfDocument] string];
     } else if ([dPO isKindOfClass:[PDFPage class]]) {
         if (page == nil || [page isEqual:dPO])
-            textStorage = [dPO richText];
+            string = [dPO string];
     } else if ([dPO isKindOfClass:[PDFAnnotation class]]) {
         if (page == nil || [page isEqual:[dPO page]])
-            textStorage = [dPO textContents];
+            string = [dPO string];
     } else {
-        attrString = [[PDFSelection selectionWithSpecifier:dP onPage:page] 
attributedString];
+        string = [[PDFSelection selectionWithSpecifier:dP onPage:page] string];
     }
     
-    return textStorage ?: attrString ? [[[NSTextStorage alloc] 
initWithAttributedString:attrString] autorelease] : [[[NSTextStorage alloc] 
init] autorelease];
+    return string ?: @"";
 }
 
 @end

Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef     2009-01-17 16:16:25 UTC (rev 5127)
+++ trunk/Skim.sdef     2009-01-17 22:29:12 UTC (rev 5128)
@@ -1322,7 +1322,7 @@
                 description="The page on which to get the text.">
                 <cocoa key="Page"/>
             </parameter>
-            <result type="rich text"
+            <result type="text"
                 description="The text of the object."/>
         </command>
 


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:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to