Paste clipboard into active application?

I have created a script to pull text from a background application. I am using Quicksilver to run the script. I want to have the script then paste the text wherever my cursor is in whichever application I happen to be in. Here is my script to pull the text:

tell application "TimecodeUSB" to set the clipboard to (get timecode) as text

I have tried adding this:

tell application "System Events" to keystroke "v" using command down 

but it only works when I run it from Script editor and not when I use quicksilver to run it.

Thank you for any help.

Hi,

try this


tell application "System Events" to tell (1st process whose frontmost is true) to keystroke "v" using command down

That didn’t quite do it but it let me figure out how to fix it. I needed to add a delay. I think it was trying to paste into the TimecodeUSB so with the delay it makes the application I was in the frontmost process…
what worked:

tell application "TimecodeUSB" to set the clipboard to (get timecode) as text
delay 0.01
tell application "System Events" to tell (name of application processes whose frontmost is true) to keystroke "v" using command down

Figuring out to use the process helped me a lot.
Thank you

Brad