As I understand your question, the problem is really that you can't get it out of the cookie press, and not an issue of the dough "flattening" once it hits the baking sheet.
If that's correct, then there are a few different factors that could be contributing: You might not be using a strong enough flour.
I've always used a 1:1 mix of bread flour and pastry flour.
All-purpose flour isn't great for spritz cookies and many home baking recipes do odd things to try to strengthen the dough to compensate, such as increasing the quantity of egg.
Not much more I can say without knowing the specific recipe, but try to find a recipe that doesn't use AP flour.
You might not be using enough flour, or you might have added too much water or milk.
The dough should feel relatively firm once it's well-blended, not soggy or watery.
The preparation I use also contains a good quantity of icing sugar, which has its own starch; if you're using regular granulated sugar instead then that will be a contributing factor to sogginess/stickiness.
Also don't forget to sift the flour.
Home baking recipes often make wild guesses as to the quantity of eggs, based on assumptions about the size and age of eggs you'll have.
The ratio I use is 20:13:8:6:3 (flour:fat:sugar:eggs:milk/water), by weight obviously.
If you use too much egg then you'll end up with a slimy texture that's hard to separate while raw.
You may have added the eggs all at once, which makes it difficult to incorporate without overmixing the dough (or not incorporating well enough, which again will give you that slimy texture).
Make sure you're only adding one at a time.
If your recipe calls for oil as a fat, or you're substituting oil for something else, that could be a problem.
Typically you'll want to use a mixture of about half shortening and half butter.
You don't necessarily have to use shortening, but butter has a low melting point and melting
will, again, cause your dough to become too wet.
Did you cream the fat(s) together with the sugar?
That's another important step to getting the right consistency of dough.
You should have a mixture that's light and fluffy before you add the flour, eggs, or milk.
Make sure you're adding the flour last, otherwise you risk overmixing.
As far as sticking to the baking pan itself is concerned, just line it with parchment paper and don't grease it.
If you've made the dough properly then it will "set" and not sink.
FWIW, I also find it easier to pipe spritz cookies than to use a cookie press.
cooking.stackexchange.com/users/41/Aaronut
Chill the cookie sheets in between batches.
Stick them in the freezer or outside (depending on the outdoor temperature).
I was having the same problem and this was my mother's solution.
cooking.stackexchange.com/users/14847/Angie
maybe you need to chill the cookies, they might be too liquidy from the room temperature
cooking.stackexchange.com/users/14707/Elie Lambbert
I just discovered that the disc in my press was in upside down.
It had nothing to do with the temperature of the dough or the pan.
Now it is working perfectly.
So check your disc if your Spritz dough is not sticking to your pan.
cooking.stackexchange.com/users/71497/S L Breedlove
You must use cooled off cookie sheets so the cookies will stick to pan and come out of the press with no problem.
Cookie sheets can not be warm.
That is the answer.
cooking.stackexchange.com/users/None/
Place the cookie sheets in the fridge before using.
Also wash the cookie sheets after each use to remove butter and then place in the fridge.
I've also noticed, if I press the cookie press and then lift up from the cookie sheet real quick, it seems to help too.
cooking.stackexchange.com/users/41794/V Foster
We're having a good deal of trouble getting our spritz cookies from our cookie press to separate from the cookie press and stick to the cookie sheet. Is there something we can add to the cookie batter to make them separate from the cookie press and attach to the pan more easily?
Spritz cookies not sticking to pan when pressed from cookie press
cooking.stackexchange.com
<baking><cookies>
cooking.stackexchange.com/questions/10277
cooking.stackexchange.com/users/3891/David Kanenwisher
Make sure the cookie dough and sheets are cold before adding a batch, and check your disc if the dough is not sticking to the pan.  Your dough and the cookie sheets could be cool for each batch otherwise the dough will stick.
Chill the dough and the cookie sheet before baking. Check your disc is the right way round.