无法将应用程序制作成类型应用程序

Can’t make application into type application

脚本错误:无法将应用程序转换为类型应用程序。 (-1700) 检测到错误的参数数据或执行强制时出现故障。 (第 17 行,第 28 个字符)。我认为这可能是我的弹出对话框或编写以下行脚本的问题。

using terms from application 'Messages'
  on message sent theMessage with eventDescription
    display dialog (eventDescription)
  end message sent

  on message received theText from theBuddy with eventDescription
  end message received

  on chat room message received theText with eventDescription from theBuddy for theChat
    set getname to name of theBuddy as text
    try 
      set myresult to get id of theBuddy
    on error errMsg
      set errMsgParts to splitText(errMsg, "\"")
      set errCount to count of errMsgParts
      set myresult to item (errCount - 1) of errMsgParts
    end try 
    display dialog ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
    do shell script ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
  end chat room message received

  on active chat message received theText with eventDescription from theBuddy for theChat
    try 
      set myresult to get id of theBuddy
    on error errMsg
      set errMsgParts to splitText(errMsg, "\"")
      set errCount to count of errMsgParts
      set myresult to item (errCount - 1) of errMsgParts
    end try 

    display dialog ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
    do shell script ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
  end active chat message received

  on addressed message received theText with eventDescription from theBuddy for theChat
    set getname to name of theBuddy as text
    try 
      set myresult to get id of theBuddy
    on error errMsg
      set errMsgParts to splitText(errMsg, "\"")
      set errCount to count of errMsgParts
      set myresult to item (errCount - 1) of errMsgParts
    end try 
    display dialog ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
    do shell script ("/Home/Peter/repos/imessage/message '" & theText & getname & myresult & "'")
  end addressed message received

  on received text invitation with eventDescription
  end received text invitation

  on received audio invitation theText from theBuddy for theChat with eventDescription
  end received audio invitation

  on received video invitation theText from theBuddy for theChat with eventDescription
  end received video invitation

  on buddy authorization requested with eventDescription
  end buddy authorization requested

  on addressed chat room message received with eventDescription
  end addressed chat room message received

  on login finished with eventDescription
  end login finished

  on logout finished with eventDescription
  end logout finished

  on buddy became available with eventDescription
  end buddy became available

  on buddy became unavailable with eventDescription
  end buddy became unavailable

  on received file transfer invitation theFileTransfer with eventDescription
  end received file transfer invitation

  on av chat started with eventDescription
  end av chat started

  on av chat ended with eventDescription
  end av chat ended

  on completed file transfer with eventDescription
  end completed file transfer

end using terms from

我只是将 'Messages' 更改为 "Messages" 这样我就可以编译了,也许这会对你有所帮助。

将第一行更改为:

using terms from application 'Messages'

收件人:

using terms from application "Messages"

希望对您有所帮助!