1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

awakefromnib in applescript application

Discussion in 'Mac Programming' started by trainguy77, Jul 27, 2006.

  1. macrumors 68040

    trainguy77

    #1
    How would I go about running some objective-C lines which need to run in awakefromnib in an applescript application?
     
  2. macrumors 68040

    MongoTheGeek

    #2
    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
     
  3. macrumors 68040

    trainguy77

    #3
    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?
     

Share This Page