Revision: 2527
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2527&view=rev
Author:   hofman
Date:     2007-07-18 11:53:36 -0700 (Wed, 18 Jul 2007)

Log Message:
-----------
Pass pdfsync command through osascript when it is an applescript file.

Modified Paths:
--------------
    trunk/SKDocument.m

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-07-18 18:19:48 UTC (rev 2526)
+++ trunk/SKDocument.m  2007-07-18 18:53:36 UTC (rev 2527)
@@ -38,6 +38,7 @@
 
 #import "SKDocument.h"
 #import <Quartz/Quartz.h>
+#import <Carbon/Carbon.h>
 #import "SKMainWindowController.h"
 #import "NSFileManager_ExtendedAttributes.h"
 #import "SKPDFAnnotationNote.h"
@@ -926,6 +927,14 @@
         [cmdString insertString:@"\" " atIndex:0];
         [cmdString insertString:editorCmd atIndex:0];
         [cmdString insertString:@"\"" atIndex:0];
+        
+        NSString *extension = [editorCmd pathExtension];
+        if (extension) {
+            NSString *theUTI = 
[(id)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, 
(CFStringRef)extension, NULL) autorelease];
+            if (theUTI && UTTypeConformsTo((CFStringRef)theUTI, 
CFSTR("com.apple.applescript.script")) || UTTypeConformsTo((CFStringRef)theUTI, 
CFSTR("com.apple.applescript.text")))
+                [cmdString insertString:@"/usr/bin/osascript " atIndex:0];
+        }
+        
         NSTask *task = [[[NSTask alloc] init] autorelease];
         [task setLaunchPath:@"/bin/sh"];
         [task setArguments:[NSArray arrayWithObjects:@"-c", cmdString, nil]];


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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to