The Flying Meat Wiki : AcornNewImageAction

HomePage :: Categories :: PageIndex :: RecentChanges :: Login/Register
Most recent edit on 2007-11-12 10:14:58 by GusMueller

Deletions:
cacaraco



Edited on 2007-11-11 13:47:37 by LarolC4tba

Additions:
cacaraco



Edited on 2007-11-10 18:14:53 by GusMueller

Deletions:
c4tpasno



Edited on 2007-11-10 15:44:51 by CadelDomre

Additions:
c4tpasno



Edited on 2007-09-25 15:22:55 by GusMueller

Additions:
Back to AcornPlugins



Oldest known version of this page was edited on 2007-09-25 15:21:52 by GusMueller []
Page view:

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
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.3
Page was generated in 0.0771 seconds