Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why is the if/then not being interpreted by Script Editor?

Can someone explain why the if/then isn't being recognized by Script Editor? The error I receive is "Expected “then”, etc. but found unknown token."


tell application "Music"

repeat with theTrack in selection

if artist of theTrack != 'Various Artists' then

set theArtist to (get artist of theTrack)

set comment of theTrack to theArtist

set artist of theTrack to "Various Artists"

set album artist of theTrack to "Various Artists"

end if

end repeat

end tell


TIA,

David

MacBook Pro 13”, macOS 10.15

Posted on Aug 26, 2020 10:02 AM

Reply
9 replies
Sort By: 

Aug 26, 2020 11:01 AM in response to drschwartz

tell application "Music"
repeat with theTrack in selection
if artist of theTrack != 'Various Artists' then
set theArtist to (get artist of theTrack)
set comment of theTrack to theArtist
set artist of theTrack to "Various Artists"
set album artist of theTrack to "Various Artists"
end if
end repeat
end tell

There's no 'then' in the script.

Reply

Why is the if/then not being interpreted by Script Editor?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.