Revision: 6740
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6740&view=rev
Author:   hofman
Date:     2010-08-26 20:46:47 +0000 (Thu, 26 Aug 2010)

Log Message:
-----------
write text notes from tool as property list data rather than encoded string data

Modified Paths:
--------------
    trunk/SkimNotes/NSFileManager_SKNToolExtensions.m
    trunk/SkimNotes/skimnotes.m

Modified: trunk/SkimNotes/NSFileManager_SKNToolExtensions.m
===================================================================
--- trunk/SkimNotes/NSFileManager_SKNToolExtensions.m   2010-08-26 17:29:12 UTC 
(rev 6739)
+++ trunk/SkimNotes/NSFileManager_SKNToolExtensions.m   2010-08-26 20:46:47 UTC 
(rev 6740)
@@ -164,16 +164,15 @@
                     rtfNotesData = SKNSkimRTFNotes(notes);
             }
         }
-        NSData *textNotesData = [textNotes 
dataUsingEncoding:NSUTF8StringEncoding];
         if ([extension caseInsensitiveCompare:PDFD_EXTENSION] == 
NSOrderedSame) {
             NSString *name = [[path lastPathComponent] 
stringByDeletingPathExtension];
             if ([name caseInsensitiveCompare:BUNDLE_DATA_FILENAME] == 
NSOrderedSame)
                 name = [name stringByAppendingString:@"1"];
             NSString *notePath = [[path stringByAppendingPathComponent:name] 
stringByAppendingPathExtension:SKIM_EXTENSION];
             success = [notesData writeToFile:notePath options:0 error:&error];
-            if (textNotesData) {
+            if (textNotes) {
                 notePath = [[path stringByAppendingPathComponent:name] 
stringByAppendingPathExtension:TXT_EXTENSION];
-                [textNotesData writeToFile:notePath options:0 error:NULL];
+                [textNotes writeToFile:notePath atomically:NO 
encoding:NSUTF8StringEncoding error:NULL];
             }
             if (rtfNotesData) {
                 notePath = [[path stringByAppendingPathComponent:name] 
stringByAppendingPathExtension:RTF_EXTENSION];
@@ -182,8 +181,8 @@
         } else {
             SKNExtendedAttributeManager *eam = [SKNExtendedAttributeManager 
sharedManager];
             success = [eam setExtendedAttributeNamed:SKIM_NOTES_KEY 
toValue:notesData atPath:path options:0 error:&error];
-            if (textNotesData)
-                [eam setExtendedAttributeNamed:SKIM_TEXT_NOTES_KEY 
toValue:textNotesData atPath:path options:0 error:NULL];
+            if (textNotes)
+                [eam setExtendedAttributeNamed:SKIM_TEXT_NOTES_KEY 
toPropertyListValue:textNotes atPath:path options:0 error:NULL];
             if (rtfNotesData)
                 [eam setExtendedAttributeNamed:SKIM_RTF_NOTES_KEY 
toValue:rtfNotesData atPath:path options:0 error:NULL];
         }

Modified: trunk/SkimNotes/skimnotes.m
===================================================================
--- trunk/SkimNotes/skimnotes.m 2010-08-26 17:29:12 UTC (rev 6739)
+++ trunk/SkimNotes/skimnotes.m 2010-08-26 20:46:47 UTC (rev 6740)
@@ -42,7 +42,7 @@
 #import "SKNUtilities.h"
 
 static char *usageStr = "Usage:\n skimnotes get [-format skim|text|rtf] 
PDF_FILE [NOTES_FILE|-]\n skimnotes set PDF_FILE [SKIM_FILE|-] [TEXT_FILE] 
[RTF_FILE]\n skimnotes remove PDF_FILE\n skimnotes convert IN_PDF_FILE 
[OUT_PDF_FILE]\n skimnotes agent [SERVER_NAME]\n skimnotes protocol\n skimnotes 
help [VERB]\n skimnotes version";
-static char *versionStr = "SkimNotes command-line client, version 2.4";
+static char *versionStr = "SkimNotes command-line client, version 2.4.1";
 
 static char *getHelpStr = "skimnotes get: read Skim notes from a PDF\nUsage: 
skimnotes get [-format skim|text|rtf] PDF_FILE [NOTES_FILE|-]\n\nReads Skim, 
Text, or RTF notes from extended attributes of PDF_FILE or the contents of PDF 
bundle PDF_FILE and writes to NOTES_FILE or standard output.\nUses notes file 
with same base name as PDF_FILE if SKIM_FILE is not provided.\nReads Skim notes 
when no format is provided.";
 static char *setHelpStr = "skimnotes set: write Skim notes to a PDF\nUsage: 
skimnotes set PDF_FILE [SKIM_FILE|-] [TEXT_FILE] [RTF_FILE]\n\nWrites notes to 
extended attributes of PDF_FILE or the contents of PDF bundle PDF_FILE from 
SKIM_FILE or standard input.\nUses notes file with same base name as PDF_FILE 
if SKIM_FILE is not provided. Writes a default form for the text formats based 
on the contents of SKIM_FILE if TEXT_FILE and/or RTF_FILE are not provided.";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to