如何通过xcode运行AppleScript

时间:2014-11-20 02:09:20

标签: xcode cocoa applescript

我试图通过xcode设置MacOSX应用程序来发送iMessage。我有一个AppleScript,我已经通过Automator测试以确保它的工作原理。但是,我希望能够将参数传递给apple脚本,使其看起来像这样:

on run(thisContact, thisNumber, thisMessage)

    tell application "Messages"
        set targetService to 1st service whose service type = iMessage
        set targetBuddy to buddy phoneNumber of targetService
        repeat thisNumber times
            send thisMessage to thisContact
        end repeat
    end tell
end run

如何从xcode运行这样的脚本?

0 个答案:

没有答案