Keep Certain Programs Behind Others While AppleScript Is Running?

Hello, Merry X-Mas by the way

My problem is when running certain scripts of mine, they call programs that may not always be hidden, Example Mail. When browsing the web, and when the script reaches the tell application mail command to send a new message, mail always comes in front and if I’m typing something, I have to click back into firefox to type away again.

How can I avoid this problem other then actually not running the script?

Are you doing something like this?

tell application "SomeApp"
	activate
	-- then you do stuff
end tell

If so, you may not need “activate”.

Oh cool, just remove activate and it does not become foremost application.
Thanks.