导出Library.scpt:执行错误:无法将窗口1的«class txtf»1的«class valL»设置为“testing”。 (-10006)

时间:2017-01-30 16:17:42

标签: applescript

使用“osascript Export \ Library.scpt / Users / bryandunphy / Development / iTunesLibraryConsolidator testing”调用该脚本。

错误发生在最后一行。

以下是相关代码:

on run (clp)
    if clp's length is not 2 then error "Incorrect Parameters"
    local destination, libraryName
    set destination to clp's item 1
    set libraryName to clp's item 2
    menuClick({"iTunes", "File", "Library", "Export Library…"})
    set the value of the front window's text field 1 to libraryName

1 个答案:

答案 0 :(得分:0)

此脚本适用于使用macOS Sierra的iTunes 12.5.5.5:

tell application "System Events" to set value of text field "Save As:" of window "iTunes" of application process "iTunes" to "yourNewLibraryName"

或者,将其调整为您的变量:

tell application "System Events" to set value of text field "Save As:" of window "iTunes" of application process "iTunes" to libraryName

顺便说一下,您也可以使用text field 1

这对你有用吗?