Macros don't know if your search text returns any results or not. You would need to implement your own macro method that takes the search text from the url and executes our search API to find out if it returns something and then you would return true/false for the Visible field, but it's not a nice solution because you would execute the searching api twice.
A better solution is to clone the search web part and extend it by your logic.