PDA

View Full Version : awakefromnib in applescript application




trainguy77
Jul 27, 2006, 07:54 PM
How would I go about running some objective-C lines which need to run in awakefromnib in an applescript application?



MongoTheGeek
Jul 27, 2006, 09:01 PM
How would I go about running some objective-C lines which need to run in awakefromnib in an applescript application?

You could put them in the awakeFromNib method of custom class and have that instantiated in the nib.

-or-

call method "foo" of class "bar"

inside of the awakeFromNib of the AppleScript and attach that to some object

trainguy77
Jul 27, 2006, 10:13 PM
Ok I am trying one thing but it does not seem to work. I have set it up so this line is run in applescript
on awake from nib theObject
call method "awake"
end awake from nib

This runs fine as when I remove the brackets it errors. :)
However the Code does not execute. I think its something wrong with the way I set the code up.

- (void)awake
{
NSLog(@"awake");

}
The actual stuff that does the work is cut out. However that code is placed in my custom class in between @implemention and @end. I think it should work. Its probably something really straight forward. It in the custom class called customWindow. What am I doing wrong?