I don’t see any issue removing the existing tags from that line.
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
set theTags to extract keywords from record theRecord with hash tags
set n to count of theTags
if n > 0 then
if n > pMaxTags then set n to pMaxTags
set tags of theRecord to (parents of theRecord) & (items 1 thru n of theTags)
end if
end repeat
end tell
end performSmartRule
I made exactly the change you did and it didn’t work – nothing happened to the DT tags when I deleted them and tried to recreate them with the script.
Then I read your post and it did work ten times on the run – except for the couple of times in the middle when it didn’t. I really can’t discover what the difference is between those times, unless it was that I ran the rule immediately after deleting the tags for the ones that didn’t work and waited a few seconds longer on the others…
Oh well, another mystery… I’ll use this and run the occasional cmd-a data>tags>convert when I remember.
Thanx Jim, the reason why it was not working was that I chose “markdown” and not “md markdown” as extension. MP3 Files are also listed as “mp3-audio” and not as “mp3”. What ist the difference ?
The list of extensions is retrieved from the database(s), their description from macOS (which might pull it from installed third-party apps). A screenshot would be useful.
I have i.A. Writer installed - don’t know if the multiple entries are because of it. Isn’t this unnecessary complicated (for you and for us) - I would prefer (optinoally) to type in the suffix directly.
Regarding the rules this is not a big deal because you invest some time to find a solution… but in search dialog you have the same problem and you don’t want to spend time there to experiment with the different possibilities.
Could the list also be sorted please?!
But to my first question: Can I wait for DT to update the tags after the file has been edited externally? I don’t want to work with an hourly trigger where I don’t know what the sync state is on my devices.
You will have to be more specific as to what you are trying to achieve, how and what is happening. (It does work, so we have to look into why it isn’t working for you).