Pages

Saturday, February 2, 2013

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

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:

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

 

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

            class="LoginCommand"/>

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

  key="LoginName"/>

 

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

  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"

    launch

          try

          accountlogin loginName "test@mail.com" 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.


View the original article here

0 comments:

Post a Comment