applescript and xcode build and run error

Discussion in 'Mac Programming' started by mrzman, May 13, 2010.

  1. mrzman macrumors newbie

    Joined:
    May 12, 2010
    #1
    Hi all,
    I am quite new to xcode and apple script and I need help with my first project, I have been following the “hello world” tutorial and I haven’t got it to work so far. I am using xcode 3.2.
    Here is my script:

    script UntitledAppDelegate

    on applicationWillFinishLaunching_(aNotification)
    -- Insert code here to initialize your application before any files are opened
    end applicationWillFinishLaunching_

    on applicationShouldTerminate_(sender)
    -- Insert code here to do any housekeeping before your application quits
    return my NSTerminateNow
    end applicationShouldTerminate_

    end script
    on clicked theObject
    display dialog "hello world"
    end clicked

    Each time I try to build and run it fails with this
    Command /usr/bin/osacompile failed with exit code 1

    Any ideas
    Thanks
    :):apple:
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    This is the downside to using AppleScript to write your app: you don't get told where the error is and just have to guess.
     
  3. simon.ward macrumors newbie

    Joined:
    Feb 11, 2010
    #3
    Can I assume that "on clicked" is your own defined handler?
    if so, the syntax needs to be "on clicked(theObject)"
     

Share This Page