Tinderbox Forum

Agent not to create aliases but move notes from watched folder

Hello!

Task is like this: I have folder watched in Finder and I just need to get all notes from that folder and then automatically categorise them into different containers inside Tinderbox using agents. So it works except that I got aliases but I just need to move those notes from watched folder and then delete that watched container inside Tinderbox.

How it can be done?

I have just started recently so I will appreciate your help very much.

Hi, welcome to the forum. So, you want to move the original note of the alias inside the alias to a new location?

To move a note set its $Container as described here.

Now if I used this action in an agent:

$Container="/work/projects/";

as it acts on the alias, it is the alias that moves, which is not what we want! So we do this instead:

$Container(original)="/work/projects/";

See more on the ‘original’ designator.

No. I have original notes created by watching folder in Finder I just basically want to categorise those notes according to simple rules. But I don’t want to create aliases at all in fact. I just want to move original notes from first container to another one according to rules (say couple of tags).

Ok, then just set the Container attribute of the note as explained in the links above.

So, to move a note to project ‘Green’ is the note has a tag ‘green’ (case-sensitive) in the note’s $Tags:

if($Tags.contains("green"){
$Container="/work/projects/Green";
};

But, say you’ve 10 projects, ‘Green’, ‘Brown’, ‘Blue’, etc., testing for each in turn is a wasteful approach, it makes sense to make a user attribute Project with suggested values listing each project name. You can then make Project a Displayed Attribute for each note in the main container. Then the rule for the container can be:

var vChildren = collect(children,$Path);
vChildren.each(aNote){
   if($Project!=""){
      $Container = ("/work/projects/"+$Project);
   }
};

Thus if a note has a $Project value of ‘Red’, the parent container’s rule would move it to path /work/projects/Red

I have tried your first suggestion by adding $Container(original)="/work/projects/";
to Agents action. So it worked out as i wanted! :slight_smile:
Thank you very much!
As for your second reply I just didn’t get where I should put if condition. Agents query takes this role to match condition…

Sorry. the confusion is you started mentioning agents and then talked about containers. Why not upload a small Tinderbox file (.tbx). Show a specimen start and, in the file_ add note(s) describing or mocking-up the result you want to achieve. As it is it’s not as clear for us readers as it is for you. That’s not to be discourteous, I’m as prone as any to describing only bark of the beautiful picture in my own mind when sharing. :slight_smile: I’m just trying to make sure we fix the right problem for you or else you’ll just have a lot of code and no solution!

Thank you again for readiness to help! I will try to do like you say for complex things )
For now, I just can’t understand how to change size of font in existing notes. I have tried stamps (TextFontSize=16) to selected notes, but it is not working — font size is the same. About this method I saw on this forum, but it is not working.

OK, $TextFontSize apples to the note as a whole. But as soon as you write—even if in the same size style—that font/style is retained in the RTF layer.

To reset your note to the desired size style. Select all the existing text ($Text) in the text pane. then use the menu FormatStyle and select ‘Standard Size’. All text will be set to note’s current $TextFontSize.

Thank you! It works :slight_smile:
The only remaining question for now is automatic export in markdown to some outer folder. But it is completely beyond my comprehension ) I saw this one Studying classical texts with Tinderbox
but still I don’t know basics about even how to implement that code. Probably I should first learn about export in Tinderbox… I also do not understand where he puts that applescript code.