Hi jmm22243,
I understand you have a Deskjet 2540 that after sitting idle for a period has to be disconnected and reconnected to print. I'm sorry to hear this, but I will certainly do my best to assist you!
Could you tell me how the printer is connected to the Mac? Is it wireless or via USB?
I will suggest that you make sure the printer is plugged directly to a wall outlet to ensure it's got all the power it needs to function properly. If that doesn't seem to make any difference, please try resetting your printing system (don't re-add the printer to the queue just yet) and then perform a verify/repair of your disk permissions. Once they both complete reboot the computer and then re-add the printer to the queue.
Let me know how this all goes for you :)