The Flying Meat Wiki : AcornNewImageAction

HomePage :: Categories :: PageIndex :: RecentChanges :: Login/Register

Create a new image with a size set to 800x450


This plugin will make a new image with the dimensions 800x450. It works by setting a "last size" variable in the user defaults, which the default image document looks for when making new documents. It also sets ACIsAction to True, so it will show up in the File/Actions menu.

NewImage800x450.py
import objc, os, math
from Foundation import *
from AppKit import *

ACScriptSuperMenuTitle = None
ACScriptMenuTitle = "New image 800x450"
ACIsAction = True

def main(image):
   
    size = NSStringFromSize((800, 450))
   
    NSUserDefaults.standardUserDefaults().setObject_forKey_(size, 'lastSize')
   
    NSDocumentController.sharedDocumentController().newDocument_(None)
   
    # we're not changing the image, so we'll return nothing to put on
    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.0431 seconds