I want to extract a bunch of tags from the text in the form of
#tag1#tag2
some text here #tag3 more text etc.
and then put the tags in the $Tags attribute. I can’t seem to find a way to do it. Ideally I could create a set based on a grep match “#\w+” in the rule but I can’t figure it out
I’m not surprised, as your example doesn’t have a unique marker consistent for all tags. Only ‘tag2’ has a preceding hash. How do you know the line starting ‘tag3’ is a tag and not text. You need some sort of definable repeating pattern.
If you control the source I’d tweak the output to ensure all tags have a # and a space after (assumption: tags are single word, i.e. no spaces in them).
The inconsistency of tags across applications has been a pain. TB’s internal tags are not exported to Finder Tags. It is a major problem for me as it creates gaps across my system. Files I tagged inside TB are untagged when exported.
I am now thinking, if putting tags inside the $Text (#Tag) might be a solution for universal use of tags. Once the files are exported, the tags kept inside the $Text will be exported as well. The hazel or other scrip then can transfrom them to Finder tags. https://cl.ly/2q2d382O1j2F/Untitled_2017-07-04_16-17-25.png
Still, the proble with this in text tagging is the agents won’t be able to use it. is there any way of doing that? (@pstouffer mentioned grep/regex: but, I don’t know how regex can be used inside TB ).
@Desalegn, Tinderbox’s tags are stored in the attribute $Tags, whereas $Text is stored in $Text. If you want to export $Tags, add this code to your export template:
^value($Tags.format(", " ))^
If you want this in text export (as opposed to HTML export) at the same code as above but directly into the $text of notes you will export.
If you need Text export to have a option to add $Tags, I suggest you make a feature request.
Tags/keywords are a generic concept and not a universally defined thing so it should not be surprising that ‘tags’ means something - or nothing - in different apps. Whilst I understand you might wish to be able to export tags to Finder metadata, if this were possible many would need to turn it off rather than create a mess in Finder. Thus again, this would need to be an option, though at this point a feature request you may want to make.
If you want to pass $Tags data to finder, I suspect you could use runCommand() to call osascript and then hook an AppleScript to set the data.
Thank you for the suggestion. Yes, I am talking about the text export as I am generally exporting to Latex. I gave up with the html template export method because the html templates are not sufficient to contain all the attributes I want to export to the Latex document. I am relying on the rtf export -->convert the rtf to Latex.
I concur. I think this is a good task for a stamp. That is run once, on all selected notes, when you press the ‘Apply’ button on the Inspector (or click the stamp menu item).
This is really cool. Thanks Sumner Gerard. This allows a lot of flexibility to search for anything in the text and act on it (without needing explicit files for each type of search).
grabs all the people tagged with a @ and puts them in a set attribute I created called $Mentions. Since the mention may only be a partial name (i.e. pete instead of Peter) I am trying to truncate the search string to match the length of the mention. I also convert both to lowercase so that cases don’t have to match and remove the space between the first and last name so that a search for “peters” will match “Peter Stouffer”.
In the last case $MyNumber fails as you’re using the wrong context (I think), i.e. the $MyNumber for each item being tested and not the item calling the find(). I think for the latter you should use $MyNumber(that). Anyway, just to clarify the process and capturing values like m.size in attributes I tried using collect():
The upshot is the indication is that the section $FullName.replace(" ","").substr(0,$MyNumber(that)).lowercase is not getting evaluated as suggested.
There’s quite a nested level of operation here and I’ve no idea if the operators involved. I’d ask Eastgate - noting that MB is en route home from HT’17 so may not be around for some hours yet.
I have started using @pat’s great Publish from Tinderbox to DEVONthink My only problem with it is that my tagging system gets broken due to Tinderbox not exporting #Tags to Finder tags.
I read and highlight in MarginNote. This app exports quotations with #tags in their text body to rtf files with Finder tags. When those files are grabbed from DEVONthink into Tinderbox the #Tags attribute is automatically filled. I think it would make sense to equally convert #Tags in the opposite direction.
I agree that Applescript or probably xattr can be a solution. I understand it is not discussed in the posts below how to implement it. Has it been implemented by any other user who can advise on how to do it?