Revision: 12846 http://sourceforge.net/p/skim-app/code/12846 Author: hofman Date: 2022-04-20 08:56:30 +0000 (Wed, 20 Apr 2022) Log Message: ----------- Default to write skim notes as plist data
Modified Paths: -------------- trunk/SkimNotes/NSFileManager_SKNExtensions.h trunk/SkimNotes/NSFileManager_SKNExtensions.m trunk/SkimNotes/skimpdf.m Modified: trunk/SkimNotes/NSFileManager_SKNExtensions.h =================================================================== --- trunk/SkimNotes/NSFileManager_SKNExtensions.h 2022-04-20 08:47:12 UTC (rev 12845) +++ trunk/SkimNotes/NSFileManager_SKNExtensions.h 2022-04-20 08:56:30 UTC (rev 12846) @@ -127,7 +127,7 @@ /*! @abstract Writes Skim notes passed as an array of property dictionaries to the extended attributes of a file, as well as a defaultrepresentation for text Skim notes and RTF Skim notes. - @discussion Calls <code>writeSkimNotes:textNotes:richTextNotes:toExtendedAttributesAtURL:options:error:</code> with nil <code>notesString</code> and <code>notesRTFData</code> and the <code>SKNSkimNotesWritingSyncable<code> options. + @discussion Calls <code>writeSkimNotes:textNotes:richTextNotes:toExtendedAttributesAtURL:options:error:</code> with nil <code>notesString</code> and <code>notesRTFData</code> and the <code>SKNSkimNotesWritingPlist<code> and <code>SKNSkimNotesWritingSyncable<code> options. @param notes An array of dictionaries containing Skim note properties, as returned by the properties of a PDFAnnotation. @param aURL The URL for the file to write the Skim notes to. @param outError If there is an error writing the Skim notes, upon return contains an <code>NSError</code> object that describes the problem. @@ -137,7 +137,7 @@ /*! @abstract Writes Skim notes passed as an array of property dictionaries to the extended attributes of a file, as well as text Skim notes and RTF Skim notes. The array is converted to <code>NSData</code> using <code>NSKeyedArchiver</code>. - @discussion Calls <code>writeSkimNotes:textNotes:richTextNotes:toExtendedAttributesAtURL:options:error:</code> with the <code>SKNSkimNotesWritingSyncable<code> options. + @discussion Calls <code>writeSkimNotes:textNotes:richTextNotes:toExtendedAttributesAtURL:options:error:</code> with the <code>SKNSkimNotesWritingPlist<code> and <code>SKNSkimNotesWritingSyncable<code> options. @param notes An array of dictionaries containing Skim note properties, as returned by the properties of a <code>PDFAnnotation</code>. @param notesString A text representation of the Skim notes. When <code>NULL</code>, a default representation will be generated from notes. @param notesRTFData An RTF data representation of the Skim notes. When <code>NULL</code>, a default representation will be generated from notes. @@ -162,7 +162,7 @@ /*! @abstract Writes Skim notes passed as an array of property dictionaries to a .skim file. - @discussion Calls <code>writeSkimNotes:toSkimFileAtURL:options:error:</code> with zero options. + @discussion Calls <code>writeSkimNotes:toSkimFileAtURL:options:error:</code> with the <code>SKNSkimNotesWritingPlist<code> options. @param notes An array of dictionaries containing Skim note properties, as returned by the properties of a <code>PDFAnnotation</code>. @param aURL The URL for the .skim file to write the Skim notes to. @param outError If there is an error writing the Skim notes, upon return contains an <code>NSError</code> object that describes the problem. Modified: trunk/SkimNotes/NSFileManager_SKNExtensions.m =================================================================== --- trunk/SkimNotes/NSFileManager_SKNExtensions.m 2022-04-20 08:47:12 UTC (rev 12845) +++ trunk/SkimNotes/NSFileManager_SKNExtensions.m 2022-04-20 08:56:30 UTC (rev 12846) @@ -44,11 +44,11 @@ @implementation NSFileManager (SKNExtensions) - (BOOL)writeSkimNotes:(NSArray *)notes toExtendedAttributesAtURL:(NSURL *)aURL error:(NSError **)outError { - return [self writeSkimNotes:notes textNotes:nil richTextNotes:nil toExtendedAttributesAtURL:aURL options:SKNSkimNotesWritingSyncable error:outError]; + return [self writeSkimNotes:notes textNotes:nil richTextNotes:nil toExtendedAttributesAtURL:aURL options:SKNSkimNotesWritingPlist | SKNSkimNotesWritingSyncable error:outError]; } - (BOOL)writeSkimNotes:(NSArray *)notes textNotes:(NSString *)notesString richTextNotes:(NSData *)notesRTFData toExtendedAttributesAtURL:(NSURL *)aURL error:(NSError **)outError { - return [self writeSkimNotes:notes textNotes:notesString richTextNotes:notesRTFData toExtendedAttributesAtURL:aURL options:SKNSkimNotesWritingSyncable error:outError]; + return [self writeSkimNotes:notes textNotes:notesString richTextNotes:notesRTFData toExtendedAttributesAtURL:aURL options:SKNSkimNotesWritingPlist | SKNSkimNotesWritingSyncable error:outError]; } - (BOOL)writeSkimNotes:(NSArray *)notes textNotes:(NSString *)notesString richTextNotes:(NSData *)notesRTFData toExtendedAttributesAtURL:(NSURL *)aURL options:(SKNSkimNotesWritingOptions)options error:(NSError **)outError { @@ -89,7 +89,7 @@ } - (BOOL)writeSkimNotes:(NSArray *)notes toSkimFileAtURL:(NSURL *)aURL error:(NSError **)outError { - return [self writeSkimNotes:notes toSkimFileAtURL:aURL options:0 error:outError]; + return [self writeSkimNotes:notes toSkimFileAtURL:aURL options:SKNSkimNotesWritingPlist error:outError]; } - (BOOL)writeSkimNotes:(NSArray *)notes toSkimFileAtURL:(NSURL *)aURL options:(SKNSkimNotesWritingOptions)options error:(NSError **)outError { Modified: trunk/SkimNotes/skimpdf.m =================================================================== --- trunk/SkimNotes/skimpdf.m 2022-04-20 08:47:12 UTC (rev 12845) +++ trunk/SkimNotes/skimpdf.m 2022-04-20 08:56:30 UTC (rev 12846) @@ -71,15 +71,15 @@ static char *unembedHelpStr = "skimpdf unembed: converts annotations embedded in a PDF to Skim notes\n" "Usage: skimpdf unembed [-s|-n] [-p|-a] IN_PDF_FILE [OUT_PDF_FILE]\n\n" "Converts annotations embedded in IN_PDF_FILE to Skim notes and writes the PDF data with notes removed to OUT_PDF_FILE with the Skim notes written to the extended attributes.\n" - "Writes to IN_PDF_FILE when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to archive."; + "Writes to IN_PDF_FILE when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to plist."; static char *mergeHelpStr = "skimpdf merge: Merges two PDF files with attached Skim notes\n" "Usage: skimpdf merge [-s|-n] [-p|-a] IN_PDF_FILE_1 IN_PDF_FILE_2 [OUT_PDF_FILE]\n\n" "Merges IN_PDF_FILE_1 and IN_PDF_FILE_2 and Skim notes from their extended attributes and writes to OUT_PDF_FILE.\n" - "Writes to IN_PDF_FILE_1 when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to archive."; + "Writes to IN_PDF_FILE_1 when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to plist."; static char *extractHelpStr = "skimpdf extract: Extracts part of a PDF with attached Skim notes\n" "Usage: skimpdf extract [-s|-n] [-p|-a] IN_PDF_FILE [OUT_PDF_FILE] [-range START [LENGTH] | -page PAGE1... | -odd | -even]\n\n" "Extracts pages from IN_PDF_FILE and attached Skim notes in the pages, given either as a page range or a series of pages, and writes them to OUT_PDF_FILE.\n" - "Writes to IN_PDF_FILE when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to archive."; + "Writes to IN_PDF_FILE when OUT_PDF_FILE is not provided. Writes (non) syncable notes when the -s (-n) option is provided, defaults to syncable. Writes plist (archive) data when te -p (-a) option is provided, defaults to plist."; static char *helpHelpStr = "skimpdf help: get help on the skimpdf tool\n" "Usage: skimpdf help [VERB]\n\n" "Get help on the verb VERB."; @@ -283,7 +283,7 @@ int offset = 0; BOOL syncable = YES; - BOOL asPlist = NO; + BOOL asPlist = YES; if (argc < 3) { WRITE_ERROR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit