Actually, you can use AppleScript and a smattering of Shane's ASObjC, which as we know are also free to use. Try the code below as a starting point.
In simple terms, the script has an idle loop, which cycles every 5 seconds (or whatever you set it to). Each cycle, the script checks the current tags and compares them to the last know tags. If there's a difference, whatever action is needed can be taken.
Stan C.
use AppleScript version "2.5" -- El Capitan
use scripting additions
use framework "Foundation"
property folderPath : "/Users/stanc/Desktop/Holder"
property existingTags : missing value
on run
set existingTags to returnTagsFor_(folderPath)
idle
end run
on idle
set folderPath to "/Users/stanc/Desktop/Holder"
set foundTags to returnTagsFor_(folderPath)
if existingTags is not foundTags then
set existingTags to foundTags -- update property
-- do whatever needs doing, when the tags change
set dialogMessage to "The tags have changed!"
displayDialog(dialogMessage, {"Cancel", "OK"}, "OK", 2)
end if
return 5 -- seconds until next check
end idle
------------------------------------------------------------------------------------------
----------------------------------- HANDLERS -----------------------------------
------------------------------------------------------------------------------------------
on displayDialog(dialogMessage, buttonList, defaultButton, iconNum)
activate
with timeout of 14400 seconds
display dialog dialogMessage buttons buttonList default button defaultButton with icon iconNum
end timeout
end displayDialog
on returnTagsFor:posixPath -- get the tags
-- handler by Shane Stanley, 2002-12-07
set aURL to current application's |NSURL|'s fileURLWithPath:posixPath -- make URL
set {theResult, theTags} to aURL's getResourceValue:(reference) forKey:(current application's NSURLTagNamesKey) |error|:(missing value)
if theTags = missing value then return {} -- because when there are none, it returns missing value
return theTags as list
end returnTagsFor: