Extract tags from a document

I would like to manipulate the tags in a selected document based on some simple rules, thus for instance delete a specific tag and add another using applescript.

Sounds simple but I haven’t been able to solve the problem of actually accessing the tags in a document. Using

repeat with thisTag in tags of thisItem
  display dialog thisTag
end repeat

gives me an error saying that thisTag cannot be converted into a string.

Any suggestion on how to proceed from here on is very welcomed.

Many thanks
Guido

This works beautifully, many thanks!

Tags being a list is not the cause of the error:```
tell application id “DNtp”
repeat with thisTag in (get tags of content record)
display dialog thisTag
end repeat
end tell