Itās getting even more āspecialā here - sorry. I just try to understand some concepts of TBX and use them for my work.
The external path for $Fill works fine now. The next thing Iām trying to solve: after I change the $File attribute I would like to update the $Fill attribute with the name of the file.
This stamp āSetFillImageFromFileā will do it:
stamp("GetFileNameOnly");
stamp("GetFileNameNoExtension");
$Fill(original)="";
$Fill(original)=$PathFillImages("pPreferences")+$ImageName(original);
$FileIsModified=false;
The first two stamps just strip the path and the type ending from the value stored in $File.
The line with $Fill(original)="";
is there because of my new issue I run into.
First step was an $Edict with:
if(!$IsPrototype){stamp("SetFillImageFromFile")}
This worked but it seems to me that this will add some overhead to my file. I want to apply the stamp only once if the value of $File has changed. It got even worse when using it as a $Rule.
So I created a new attribute called $FileIsModified and an agent with this query:
$Prototype=="pPerson" & $File=="" & $FileIsModified==false
and a simple $AgentAction: $FileIsModified=true;
Works fine - there is a delay because the Agent will not run immediately. But thatās not my problem now.
Then I created a second Agent with this query:
$Prototype=="pPerson" & $File!="" & $FileIsModified==true
and the Action:
stamp("SetFillImageFromFile");$FileIsModified=false;
Now - after so many words - here is my problem: everything works. Only the $Fill attribute never gets set to the new value. The other three attributes will be set, but not $Fill. If I apply the stamp manually to the note all attributes were set including $Fill.
Any idea? All I need is a way to simulate an āOnChangeā event for the $Fill attribute.