I saw this on the forums somewhere last week, but can't for the life of me find it again. I saw a macro that had something like:

/script(seterrorlevel,0)
/use <trinket>
/script(seterrorlevel,1)
/cast <bigspellofdoom>

Anyone see this, and remember what the real syntax is?