Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> OnAdd syntax
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1469804018

Message started by wajakob on Jul 29th, 2016, 10:53am

Title: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 10:53am

A simple query.  After two years of adding manually the prototype reference for notes lodged inside containers (for books or primary sources), I decided to try using an OnAdd action.  Cannot make it work.  Is there a problem with the following syntax?  OnAdd:$Prototype="P-Musgrove on PFF"

Title: Re: OnAdd syntax
Post by Mark Anderson on Jul 29th, 2016, 11:10am

Assuming what you see in the Action Inspector's 'Action' sub-tab for the note is this code:

$Prototype="P-Musgrove on PFF";

The semi-colon at the end is only needed is there is another action expression (separate piece of code) to run after the above.  Assuming there is a prototype called 'P-Musgrove on PFF' then the prototype should get set.

What is (not) happening that you expect?  Wrong prototype? No prototype? Something else?

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 2:47pm

I have tried to set the OnAdd action for the container in which I want to place the notes.  No prototype is set.  In addition there is an error message which says that the OnAdd action cannot be parsed.

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 2:48pm

I meant to say that no prototype is set for any of the new notes placed in the container.

Title: Re: OnAdd syntax
Post by Mark Anderson on Jul 29th, 2016, 4:11pm

Ah. Assuming you have already created a prototype called "P-Musgrove on PFF"  the code in my last reply, add as a container's $OnAdd code will set that prototype for any note added to the container.

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 5:27pm

Unfortunately.  I have done as suggsted with no luck.  I created the container, gave it the $OnAdd:$Prototype="P-Musgrove on PFF".  Still no joy.  

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 5:51pm

Tried it with a second conainer.  Got the error message:  "This note's $OnAdd action cannot be parsed."  Back to manual entry, I guess.

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 8:47pm

It now happens that the "errors and warnings" flag that initially appeared in one container now infects every other container and note in the entire file.   Please advise.

Title: Re: OnAdd syntax
Post by wajakob on Jul 29th, 2016, 9:57pm

Problem finally solved.  No worries.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.