Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Paste contents of clipboard into active application?

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  Mounting Windows Shares on 10.5.3 server  
Author Message
google

External


Since: Jun 08, 2008
Posts: 1



(Msg. 1) Posted: Sun Jun 08, 2008 8:01 pm
Post subject: Paste contents of clipboard into active application?
Archived from groups: alt>comp>lang>applescript (more info?)

Hello,
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.

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.

Any ideas?

Thanks,
Brad

 >> Stay informed about: Paste contents of clipboard into active application? 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 543



(Msg. 2) Posted: Wed Jun 11, 2008 8:31 pm
Post subject: Re: Paste contents of clipboard into active application? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 08/06/2008, google DeleteThis @bradduns.com wrote in message <f4809ec7-5b4a-48fa-
8581-4d6eb9833817 DeleteThis @u12g2000prd.googlegroups.com>:

> 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.

Unfortunately, you can only issue keystrokes and menu commands to the
foreground application (because only those applications have control of
the screen and keyboard).

Fortunately, you can issue the 'activate' command to an application to
bring it to the foreground, and the same command to another application
(e.g. the Finder) to send it behind again.

Simon.
--
http://www.hearsay.demon.co.uk

 >> Stay informed about: Paste contents of clipboard into active application? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[newbie] Applescript application: how to quit it? - Hi, I wrote an AS appl tell application "Address Book" to activate ... end tell saved as application, unchecked "exec only", unchecked "startup screen", checked "stay in the background" I'm surprised t...

clipboard - Inside an applescript, how can I force the clipboard window to open? close window "clipboard" works; what about the right way to open it? Thanks in advance for any help. -Pierre

Setting the clipboard - Hi, I run a AS from Quickeys that get's info from the user and places it into the clipboard. Then quickeys uses that clipboard info for pasting into a application (Pro Tools). I found out that I need to clear the clipboard before I set it to make the..

How do you export the clipboard? - Hi, I just realized that, much to my surprise, the statement: Tell application "Finder" Set foldername to "xyz" set the clipboard to foldername End tell does not export the clipboard to make it available to other applications. It i...

open clipboard with Preview - Hi! How does the AppleScript have to look like in order to open the clipboard (which content is a picture) with Apple's Preview application? I have tested something like tell application "Preview" activate ...
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]