Hey Mark,
I'm doing the following...
{% if (!IsRecentResearch()) { "##DONOTSEND##" } |(identity)GlobalAdministrator%}
where IsRecentResearch() is a custom macro doing all of the work. The macro code is...
[MacroMethod(typeof(bool), "Determines if a there have been any new blog posts in the last week", 1)]
public static object IsRecentResearch(EvaluationContext context, params object[] parameters)
{
return Helper.GetRecentResearchCount() > 0;
}
and that calls the helper method that is...
public static int GetRecentResearchCount()
{
return DocumentHelper.GetDocuments("custom.ResearchItem").Count(b => b.GetDateTimeValue("BlogPostDate", DateTime.Now) >= DateTime.Now.AddDays(-7));
}
This works on version 8.1.2. What version are you on?
When I run your macro, I get a blank value for the CurrentDocument.Items.Count and therefore it's always going be false.
What are you trying to accomplish with your macro?