Action & Query code examples & workflows


(john weiland) #1
  1. I was wondering if you could share some of your brilliant action & query codes and gives us a brief/detaild explanation…main purpose, functions and roles?

  2. Where do you store your Action & Query codes and what is your workflow process when you need to retrieve it?


(Mark Anderson) #2

Re #2. Some approaches:

  • rules/edicts/display expressions all have a ‘disabled’ boolean attribute that turns them off. But beware, these don’t inherit - turning them off in a prototype doesn’t do the same in notes using that prototype
  • agents. Set the $AgentPriority to 0 (zero) or set the pop-up menu in the Agent Inspector or Get Info/agent sub-tab to ‘off’. If doing this and you have an agent action set, then delete any aliases within the agent. Once ‘off’ the query no longer runs to create new aliases but the agent action will still act on an aliases still present in the agent.
  • If you use actions a lot, add the built-in ‘Code’ prototype. This is most useful as it is predefined tot urn off all sorts of things like straight-to-curly auto-conversion of quotes that can break your code when pasted into note $Text.

Thus I tend to have a ‘Codes’ container somewhere in the doc (where depends on the layout and purpose of that doc). I give the container an OnAdd to set child notes to use the ‘code’ prototype and then add child notes into which I paste in codes I don’t want to lose but can’t turn off if left in situ.


(john weiland) #3

Mark,

Great input as usual. I wonder what will become of this community once you will eventually decide its time to disappear in the sunset :))). I know my inbox gets refreshed a lot just anticipating your name in it :).