Skip navigation

Apple script editor keeps rejecting my custom command as undefined parameter? What am I doing wrong?

353 Views 3 Replies Latest reply: Feb 1, 2013 7:31 PM by Frank Caggiano RSS
mac_dev Calculating status...
Currently Being Moderated
Feb 1, 2013 2:11 PM

I am trying to make an application apple scriptable. I have created a scripting definition by copying mail.sdef and modifying it to suit my needs as the documentation recommends. My app suite at this point only has one command in it. Here is the definition:

<suite name="NAZone" code="NAZN" description="Classes and commands for the Zone application">


  <command name="accountLogin" code="zONeLgIn" description="Triggers account login.">

            <cocoa class="LoginCommand"/>

  <parameter name="loginName" code="naun" type="text" optional="no" description="Specify the username for the account that you wish to log into">

  <cocoa key="LoginName"/>


            <parameter name="passwordStr" code="napw" type="text" optional="no" description="Specify the account password you wish to log into">

  <cocoa key="PasswordStr"/>








I am not sure what is wrong with my definition above, but AppleScript Editor keeps complaining: "Expected end of line but found identifier." at the statement where command is invoked. Here is how my test sript looks like:

tell application "NAZone"



          accountlogin loginName "" passwordStr "abcdef12345"

          on error errStr number errNum

          display dialog errStr & errNum

          end try

end tell


AppleScript Editor complains anything following the command name. I don't think my command is somehow recognized.

I new to making applications scriptable as well as apple scripting.

MacBook Pro, Mac OS X (10.7.5)
  • Frank Caggiano Level 7 Level 7 (22,760 points)

    Does your app show up in the Applescript Dictionary and if so what does it show for it?

  • Frank Caggiano Level 7 Level 7 (22,760 points)

    My knowledge of this doesn't go much farther, sorry.  Are you a member of the paid developer program by any chance? If so you should get better help there.


    If not hopefully someone will come along that might have a better handle on this.


    I can suggest from a trouble shooting standpoint is to:


    1) really go over the modifications you made to the scripting definition. Typos have to be the number one source of errors in something like this.


    2) Try to simplify the problem. Perhaps just as a test try to add a scripting addition that takes no parameters or only one.


    3) Not sure the lack of brackets in your dictionary definition is significant. Looking at other definitions in the dictionary some have the brackets but some do not. Couldn't find a pattern but you might.


    4) Finally look into the Apple doc's. There Xcode and programming stuff has been good to me you might find an answer in there somewhere.


    good luck


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.