문제

I need to write the following script inline

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

like this one

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

but I can't get it right.

도움이 되었습니까?

해결책

You don't need multilines:

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

If you do require more than one line, osascript can be used like this:

osascript -e 'tell app "Finder"' -e 'display dialog "Multi-line"' -e 'end'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top