Convert hashtags to tag option - exists, but doesn't seem to work, and isn't documented

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

The original file…

After applying the rule…

1 Like

Ok, that’s odd…

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.

Thanks again for your help!

You’re welcome

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 ?

@cgrunenberg would have to answer about the specifics on that.

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 could use the condition Filename… ends with… .suffix instead.

The next release will support this.

1 Like

Of course :see_no_evil:
thnx :slight_smile:

Is there any reason why “convert hashtags to tags” doesn’t work with Markdown files?

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).

It’s a regression of version 3.5.1 due to the revised indexing of Markdown documents, the next maintenance release will fix this.

I was wondering about that. Good to know it will be fixed soon.

Same problem here - glad to know it’s on the fix list!

Hi, I think I also have a problem to convert hashtag to tag.

This should be addressed in the next maintenance release. Thanks for your patience and understanding.

1 Like