Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trainguy77

macrumors 68040
Original poster
Nov 13, 2003
3,567
1
How would I go about running some objective-C lines which need to run in awakefromnib in an applescript application?
 

MongoTheGeek

macrumors 68040
trainguy77 said:
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

macrumors 68040
Original poster
Nov 13, 2003
3,567
1
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
Code:
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.

Code:
- (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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.