AppleScript only removing tags AS assigned

I’m trying to write a script that takes a ‘Sibelius’-file, untags it, and moves it to the folder ‘Old’ marking it as an obsolete version:

However, this script only removes tags if the script has created them. If I have run it with a label index of 1 and then later with 0, it removes it. But, if I’ve created it by right-clicking, it doesn’t work.

When I try ‘remove label’ it doesn’t compile.

Am I missing anything? Thanks!

The file extension of Sibelius files is .sib, right? Then try adding this right after the tell application "Finder" line:

do shell script "xattr -rd com.apple.metadata:_kMDItemUserTags " & quoted form of POSIX path of (target of front Finder window as alias) & "*.sib"

Works perfectly, thank you!

1 Like