Smoothly resize your windows in ASS

Do you hate it when you have to resize windows? They always like jump from one size to an other. There isn’t an AppleScript solution for this problem (At least not one I know), but you can use a bit of Objective-C. Just add this header file and one of the implementation files to your project.

HEADER

LEAVE BUTTON LEFT

LEAVE TOP LEFT

LEAVE BUTTON RIGHT

LEAVE TOP RIGHT

To call this method use this syntax in your AppleScript file:

call method "smoothlyResizeMainWindow:withWidth:withHeight:" with parameters {window 1, width, height}

I don’t know if it’s easier to do with ASOC, but since I don’t have Snow Leopard, I use this method.

I hope this is useful for someone,
ief2

May I ask for which part of the code you need the Foundation framework and the AppKit framework?

NSApplication belongs to AppKit.framework
NSRect belongs to Foundation.framework

Hmm, I’ve been using something like this for some time now and without the #import <AppKit/AppKit.h> line. The framework is added to my project but the check box (See Image: http://img684.imageshack.us/img684/5899/picture1rl.png) is not checked and it does seem to work…

Are you importing Cocoa? If so, these are the frameworks it imports.

On 10.6.2

Yes, I’m importing Cocoa and DiscRecording (on 10.5.8 if that matters). This would explain it all :wink: Thank you!

OH Thank God, I finally figured it out. I must of spent 5 hours learning objc and ASOC along the way so at least it’s experience, but that was a nightmare…And now that it works it seems so simple !!

Previous Message