當前位置:成語大全網 - 書法字典 - Swift調用applescript腳本並傳遞值。

Swift調用applescript腳本並傳遞值。

在Swift中調用AppleScript腳本和傳遞值的方法如下:

```雨燕

進口基金會

//創建NSAppleScript的實例。

let script = NSAppleScript(來源:““

運行時argv

顯示對話框“接收值:”和。argv的項目1

端線外側迂回進攻

""")

//將值傳遞給AppleScript腳本

let inputValue =“妳好,世界!”

let arguments = NSAppleEventDescriptor . list(【NSAppleEventDescriptor(string:input value)】)

let event = nsappleeventdescriptor . appleevent(withEve