What I really need is a "copy width and height tag from image" in Coda, but since I don't have that I made this little Python plugin for Acorn:
ACScriptSuperMenuTitle = None
ACScriptMenuTitle = "Copy Width and Height"
from AppKit import *
def main(image):
pb = NSPasteboard.generalPasteboard()
pb.declareTypes_owner_([NSStringPboardType], None)
s = 'width="%d" height="%d"' % (image.extent()[1][0], image.extent()[1][1])
pb.setString_forType_(s, NSStringPboardType)
return None
ACScriptMenuTitle = "Copy Width and Height"
from AppKit import *
def main(image):
pb = NSPasteboard.generalPasteboard()
pb.declareTypes_owner_([NSStringPboardType], None)
s = 'width="%d" height="%d"' % (image.extent()[1][0], image.extent()[1][1])
pb.setString_forType_(s, NSStringPboardType)
return None
And since the image I'm working on is usually open in Acorn anyway, this works out perfectly.
P.S. - did you know you can setup Acorn as an image editor for Coda? It's pretty sweet- you just right click on an image in the source list, and choose "Edit With Acorn". Any saves you make go right back to the server.