Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Alternative to drag between windows in Outline? (Read 9675 times)
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Alternative to drag between windows in Outline?
Reply #15 - Apr 20th, 2016, 5:34pm
 
aTbRef6 note on copying notes updated to reflect the point about whether links are duplicated or not.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Scott Heftler
Full Member
*
Offline



Posts: 33

Re: Alternative to drag between windows in Outline?
Reply #16 - May 10th, 2016, 2:34am
 
After some excellent discussion with Tinderbox master Mark Anderson, I've found a perfectly satisfying solution to the cut-and-paste problem. The problem was that cutting and pasting should not be used if the note (or its descendants) contain aliases elsewhere in the document (because cutting will kill them and pasting will not restore them).

My solution was to make an agent that marks notes that have non-agent-made aliases in bold. I've never used $NameBold and I'm very glad for it. It compliments the use of italics perfectly. Both are now associated with alias-hood. Here's the code:

$AgentQuery: $IsAlias & !$AgentQuery(parent(this));
$AgentAction: $NameBold=1;


As a side effect, I have grown a new perceptual organ, for knowing that a note has (non-agent) aliases out and about is itself informative, and interesting, and gives me some sense of the note's importance.
Back to top
 
 
  IP Logged
J Fallows
Full Member
*
Offline



Posts: 418

Re: Alternative to drag between windows in Outline?
Reply #17 - May 10th, 2016, 5:02am
 
Quote:
$AgentQuery: $IsAlias & !$AgentQuery(parent(this));

$AgentAction: $NameBold=1;


Thanks for this very interesting suggestion about ways to find potentially orphaned aliases ones not created (and thus automatically re-created) by agents.

I have a very literal-minded question about the code in your example. I understand that in the sample above, the attributes shown in blue are descriptions. You want to set the agent's query to the expression you show after ":" on the first line, and the agent's action to the expression after ":" on the second line.

What I have to ask is about the attribute shown in red. Are you saying to literally type in "$AgentQuery" as part of the query description? Or, the path-and-name of the agent itself? Sorry not to immediately grasp this, but it seems very useful so I would be grateful if you could further spell it out. Thanks!
Back to top
 
« Last Edit: May 10th, 2016, 5:08am by J Fallows »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Alternative to drag between windows in Outline?
Reply #18 - May 10th, 2016, 5:58am
 
!$AgentQuery(parent(this))

$AgentQuery(parent(this)) fetches the value of $AgentQuery for the parent of the item currently being evaluated. In a query this is essentially a Boolean test - is there a value (true) or no value (false). The '!' prefix flip the evaluated boolean.

For an alias created by an agent, i.e. its child, the $AgentQuery(parent(this)) test is true as the agent has a query. Thus $AgentQuery(parent(this)) is only false if the alias being evaluated is not the child of an agent.

As the desired query is for $AgentQuery(parent(this)) of false to be true, i.e. to match the query, the '!' prefix does the job of flipping the boolean outcome. See more on the !$AttributeName syntax.

Aside: if a straight ! prefix doesn't work in a query, as in !$AgentQuery(parent(this)), you can try the more explicit !() form as in !($AgentQuery(parent(this)))
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
J Fallows
Full Member
*
Offline



Posts: 418

Re: Alternative to drag between windows in Outline?
Reply #19 - May 10th, 2016, 8:01am
 
Mark A, thanks for yet another quick and clear explanation! In my prowling through Tinderbox land I of course have come across the ! operator for Boolean searches and queries. But I hadn't ever put the attribute $AgentQuery to use. And now I can give it a try. Appreciate it.
Back to top
 
« Last Edit: May 10th, 2016, 8:03am by J Fallows »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Alternative to drag between windows in Outline?
Reply #20 - May 10th, 2016, 9:47am
 
On a more general note, if you need to ask if something is an agent, $AgentQuery!="" and things that co-erce to the same, are good tests for this. This is useful if you were hunting for an $IsAgent attribute (there isn't one).

I should note that an agent can have no query set, in which case the above fails.  However, generally I find one is testing for an active agent so the above suffices.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
J Fallows
Full Member
*
Offline



Posts: 418

Re: Alternative to drag between windows in Outline?
Reply #21 - May 10th, 2016, 1:36pm
 
And, just to close the loop (at least one that had been left open in my own mind), I do now understand that a test for $AgentQuery, or for $AgentQuery!="", is another way of testing for the (nonexistent) attribute $IsAgent.

I was imagining something more rococo, but now I see the simple elegance of the test !$AgentQuery(parent(this)) or $AgentQuery(parent(this))!="" , as a way of determining whether you are locating a stand-alone alias, or one generated by an agent. Thanks!
Back to top
 
 
  IP Logged
Pages: 1 2 
Send Topic Print