Newer
Older
Inkscape-wrapper / Inkscape-wrapper / AppDelegate.applescript
--
--  AppDelegate.applescript
--  Inkscape-wrapper
--
--  Created by Nigel Stanger on 27/01/2014.
--  Copyright (c) 2014 Nigel Stanger. All rights reserved.
--

script AppDelegate
    property parent : class "NSObject"
    
    property inkscapeBinary : "/opt/local/bin/inkscape"
	
    on applicationWillFinishLaunching_(aNotification)
        -- Insert code here to initialize your application before any files are opened
    end applicationWillFinishLaunching_
	
    on applicationShouldTerminate_(sender)
        -- Insert code here to do any housekeeping before your application quits
        return current application's NSTerminateNow
    end applicationShouldTerminate_
    
    on open (theItems)
        set commandString to inkscapeBinary & " "
        repeat with thisItem in theItems
            tell application "System Events"
                set itemProperties to thisItem's properties
                set itemPath to POSIX path of itemProperties
            end tell
            set commandString to commandString & quoted form of itemPath & " "
        end repeat
        set commandString to commandString & " >/dev/null &"
        display dialog commandString
        quit
    end open
	
end script