1

我需要内联编写以下脚本

tell app "Spotify Queue"
    addTrack "spotify:track:7sa1xOgT1c8xQfbSL5FrCe"
end tell

像这个

sh('osascript -e \'tell app "Spotify" to playpause\'')

但我做错了。

4

1 回答 1

1

您不需要多行:

tell app "Spotify Queue" to addTrack "spotify:track:7sa1xOgT1c8xQfbSL5FrCe"

如果您确实需要不止一行,可以像这样使用 osascript:

osascript -e 'tell app "Finder"' -e 'display dialog "Multi-line"' -e 'end'
于 2013-01-05T20:36:02.947 回答