Hartshorn is a leavening agent, and a precursor to the baking soda and baking powder that everyone uses these days. Hartshorn’s virtue is that it readily breaks down into a gas when heated (causing the leavening), but unless it escapes completely, it leaves a hint or more of the smell of ammonia. For that reason, it is generally used only in cookie recipes where it doesn’t have to fight its way out of a deep batter.
Hartshorn is also called baker's ammonia or ammonium bicarbonate, the latter of which should be available in at least some drug stores, but you must first grind it to powder to use it. A thoughtful reader says you may have more success finding baker's ammonia in Mediterranean or Middle Eastern groceries. "The brand they usually sell is called Krinos, and the product name is 'Ammonia Baking Powder.'"
We think substituting baking powder (in a ratio of 1 teaspoon per cup of flour) would be a perfectly good solution if you can't or won't purchase hartshorn. If the recipe you’re using includes a particularly acidic ingredient (such as buttermilk), you might instead substitute baking soda, in the ratio of 1/4 teaspoon per cup of flour.