AppleScript won't take focus on launch

I’ve got a small AppleScript tool I’ve created and when launched directly, it takes focus. Great.

If, however, I launch it via Automator’s “Launch Application” service so that I can assign a keyboard shortcut to it, it doesn’t take focus - it becomes the last item in my list of active applications and I get the standard Apple error “boing”.

Is there any way to get this to take focus when it is launched via Automator?

Do you tell it to Activate?

tell me to
activate
end tell

Add an AppleScript action below, and in it type

tell application “Safari” --replace Safari with name of your app
activate
end tell

This will force your application to the front if you put it right after you launch it.

Thanks very much. I’ll give that a try.

Bowjest