The Flying Meat Wiki : AcornQuickSavePlugin

HomePage :: Categories :: PageIndex :: RecentChanges :: Login/Register
You can also write scripts to do something other than filter an image. For example- here's a script that'll save the current image as a tiff, and it also sets the ACIsAction flag to true, so it'll show up in the File->Actions menu.

QuickTiffSave.py
import objc, os
from Foundation import *
from AppKit import *

ACScriptSuperMenuTitle = None
ACScriptMenuTitle = "Quick save as TIFF"
ACShortcutKey = 'i'
ACShortcutMask = "command control"
ACIsAction = True

def main(image):
   
    doc      = NSDocumentController.sharedDocumentController().currentDocument()
    data     = doc.dataRepresentationOfType_('public.tiff')
    filePath = doc.fileName().stringByDeletingPathExtension() + ".tiff"
   
    # this will overwrite any file that may already be there
    data.writeToFile_atomically_(filePath, True)
   
    return None




Back to AcornPlugins
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.3
Page was generated in 0.0551 seconds