Last active
May 15, 2020 19:34
-
-
Save taiyoslime/9a81eb77fccc1454d5d43f7ea611db82 to your computer and use it in GitHub Desktop.
iTunesで再生されてる曲を取得するやつ(Mac)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript -l JavaScript | |
app = Application("com.apple.iTunes"); | |
name = app.currentTrack().name() | |
artist = app.currentTrack().artist() | |
album = app.currentTrack().album() | |
duration = app.currentTrack().duration() | |
sec = duration / 60 | 0 | |
min = duration % 60 | 0 | |
if(min < 10) min = "0" + min | |
result = `${name} - ${artist}/${album} [${sec}:${min}]` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment