How to copy string to clipboard w/o keystroke?

I want to copy short strings into another program.
Currently I write to a String Indicator, highlight with the mouse, then copy.
Is there a way to write the string directly to the OS's clipboard?

You could also try this attachment
Joe.
"NOTHING IS EVER EASY"
Attachments:
clipboard.llb ‏61 KB

Similar Messages

  • Copy String to Clipboard

    Can this be done? In a simple way? It's not very important, but if i could do it it would be fairly helpful...

         try {
              BufferedReader read = new BufferedReader(new FileReader("SecretMessage.txt"));
              String readMessage = read.readLine();
              StringSelection ss = new StringSelection(readMessage);
              Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, ss);
              JOptionPane.showMessageDialog(null,"Your Encoded//Decoded Message is:\n\n" + readMessage + "\n\nMessage has also been copied to the clipboard.\nPress \"CTRL+V\" to paste this message.");
              read.close();
         catch (IOException e) {}Gives me:
    SecretMessage.java:173: cannot find symbol
    symbol : class StringSelection
    location: class SecretMessage
              StringSelection ss = new StringSelection(readMessage);
              ^
    SecretMessage.java:173: cannot find symbol
    symbol : class StringSelection
    location: class SecretMessage
              StringSelection ss = new StringSelection(readMessage);
              ^
    SecretMessage.java:174: cannot find symbol
    symbol : variable Toolkit
    location: class SecretMessage
              Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, ss);
              ^
    Am I missing some packages or something?

  • How to copy HTML to clipboard?

    Hi,
    I would like to be able to copy HTML (text + HTML tags) to the system clipboard. The copy method in the JTextPane only copy the text part to the clipboard.
    Anybody gets the idea? Thanks a lot.

    You will have to implement your own Transferable class and also have your own class extending DataFlavor.

  • How to copy String arraylist to Jlist array

    Hi,
    i tried using setModel(new AbstractListModel() method to copy the arraylist but to no valid as I cant copy it over. Can I have some advice on this, is the method i working on correct ?

    Hi all,
    regarding the first part where pass of string array into object. I have done it (thanks again for the help). But regarding the add and remove elements from the Jlist cant be done.. below is my code for the delete button when press. I cast it into int for the ManualList.getSelectedIndex();(at part A) but cant display and keep having a error call
    java.lang.NullPointerException at ManualChange&ValueReporter.valueChanged
    code for value reporter is at part B
    Part A
    private void deleteMouseClicked(MouseEvent e)
    int n =(int)ManualList.getSelectedIndex();
    if (!(n < 0) || (n > listModel.size()))
    listModel.remove(n);
    delete.setEnabled(false);
    ManualList.repaint();
    ManualList.revalidate();
    Part B
    private class ValueReporter implements ListSelectionListener {
    public void valueChanged(ListSelectionEvent event) {
    // if (!event.getValueIsAdjusting())
    // gettext.setText(ManualList.getSelectedValue().toString());
    ManualList.repaint();
    ManualList.revalidate();
    Any help is greatly appreciated.

  • How to Copy a value of a String to the RAM memory?

    Hi there,
    I was wondering how to copy a String into the ram memory (consider you're doing right click on THIS word and choose 'Copy'; the String's Value will be to the ram memory for a later Paste).
    In my application, a user has a table and he right click on it and choose Copy. I get the value of the item (Obj) but face dificulties to add it to RAM.
    my code looks like this:
              if (obj!=null)  //inside I have the value (say: 12345 --< Obj.toString)
                   Action copyAction = TransferHandler.getCopyAction();
                   int id = ActionEvent.ACTION_PERFORMED;
                   String name =  (String) copyAction.getValue(Action.NAME);
                   long l = EventQueue.getMostRecentEventTime();
                   copyAction.actionPerformed(new ActionEvent(XXXXXXX, id, name, l ,0));     
                            ///what comes in the XXXXXXX      
              }I tried, instead of the XXXXXXX, to put Obj or Obj.toString but...nothing.
    Anyone?

    Thanks,
    should implement ClipboardOwner
    and do this:
                  StringSelection stringSelection = new StringSelection( obj.toString() );
                  Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
                  clipboard.setContents( stringSelection, this );
    @Override
         public void lostOwnership(Clipboard clipboard, Transferable contents)
              //do nothing!
         }

  • How to copy a JS variable to the clipboard

    I have a script that determines the distance between two guides.
    I would like that variable to be copied to the clipboard so that a user can enter it into the control panel if one wishes.
    The copy() function will only copy something that is selected in the ID file itself.
    Any hints on how to start?
    Thanks,
    Tom

    Hello,
    I took up try67's suggestion because I cannot find any property that will copy to the clipboard.
    The following works fine...for one number! A five digit number with a decimal (or even just two digits) overflows the text box. Text that overflows cannot be selected.
    I think that the easiest solution is to make the pointSize of the text really small but for the life of me I cannot decipher how to do that.
    Any suggestions on adding one or two lines to solve this? I figure the best place to put this property is in the frameProps property record.
    Tom
    var a = 7;
    numToCopy(a);
    function numToCopy(numToCopy){
    var frameProps = {contents:numToCopy.toString()}
    var myTextFrame = app.activeDocument.textFrames.add(frameProps);
    myTextFrame.words.everyItem().select();
    app.copy();
    myTextFrame.select();
    myTextFrame.remove();
    }//end function numToCopy

  • How do I retrieve/view content that I've copied to the clipboard at various times over the course of the evening ??

    Is it possible to look at different content I've copied to the clipboard at several times over the course of an hour or two. Note: I have NOT turned off my browser or restarted my computer.

    Nope, the Windows clipboard only save one item at a time. Copy something and the previous "copy" is gone. You would need a Windows program that saves multiple clipboard entries.

  • More DataFlavors copied to the clipboard/used in D&D in one step

    Hallo,
    For my GUI app. I would like to enable different types of information to copied to the clipboard.
    e.g. object type 1 - Document ID ( actual row's document ID from JTable ) - to copy document type
    object type 2 - string representation ( columns texts from JTable ) - to copy to excel
    I would like to keep them general, with different possible combinations
    among them ( up to 10 different object types ), according to some specs.
    Has anybody idea, if it is possible ? ( prefarably with 1.4 D&D interface ).
    Data are packed in createTransferable() call, but it allows just 1 format (?) ...
    Maybe I can use some 'envelope' format holding all possible information,
    but that idea doesn't looks nice for me :(
    Thanks for any hint.
    Tibor

    Hi !
    Thanks for your help. For drag & drop it's fine. System will ask for 'best' format as I expect.
    How is it with clipboard ? I had idea to copy table columns as a "text" flavor
    ( for paste into excel ) and user created flavor "id" with documentId inside.
    On paste I would take 'what's better' ( e.g. as a document reference better would be better my "id" flavor,
    because that information doesn't need to be in table cells inside ).
    Maybe I will have to use 'own' clipboard for these reasons.
    Tibor

  • Copying Image to clipboard

    I would like to copy graphics (e.g. plot or table) in the application to the SystemClipboard. The goal is to be able to transfer this image to the other application.
    It is rathewr simple to copy text, however it is not clear how to copy graphics.
    Anybody has experience?
    Code snippet would be helpful
    Thank you.
    Leo

    If you have access to JDK 1.4, you can use java.awt.Robot quite simply with the predefined imageFlavor. Before that, I don't know how to get the system to recognize the Image flavor really...anyone?
    Here is an example how with 1.4:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.datatransfer.*;
    public class MySystemClipboard extends Frame implements ActionListener,
    ClipboardOwner
        private Button myButton;
        private Clipboard myClipboard;
        private PrettyPicture myPicture;
        public MySystemClipboard()
            add(myButton = new Button("Klipp"), BorderLayout.SOUTH);
            add(myPicture = new PrettyPicture(), BorderLayout.CENTER);
            myButton.addActionListener(this);       
            myClipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        public void actionPerformed(ActionEvent anEvent)
            try
                ClipImage ci = new ClipImage(new Robot().createScreenCapture(getBounds()));              
                myClipboard.setContents(ci, this);
            catch (AWTException ae){}
        public void lostOwnership(Clipboard clipboard, Transferable contents) 
        private class ClipImage implements Transferable
            private DataFlavor[] myFlavors;               
            private BufferedImage myImage;
            public ClipImage(BufferedImage theImage)
                myFlavors = new DataFlavor[]{DataFlavor.imageFlavor};
                myImage = theImage;
            public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException
                if (flavor != DataFlavor.imageFlavor)
                    throw new UnsupportedFlavorException(flavor);
                return myImage;
            public  DataFlavor[] getTransferDataFlavors()
                return myFlavors;
            public boolean isDataFlavorSupported(DataFlavor flavor)
                return (flavor == DataFlavor.imageFlavor);
        private class PrettyPicture extends Panel
            public PrettyPicture()
                setBackground(Color.blue);
                add(new Button("Moo"), BorderLayout.NORTH);
                add(new Button("Boo"), BorderLayout.CENTER);
                add(new Button("Roo"), BorderLayout.SOUTH);
        public static void main(String[] args)
            MySystemClipboard cb = new MySystemClipboard();
            cb.setBounds(200,200,200,200);
            cb.setVisible(true);
    }This works for me with JDK1.4 in Windows NT, using Word to verify the clipboard contents (pasting in pictures). This does not work in previous versions, since DataFlavor.imageFlavor didn't exist then. I don't know of any equivalent substtitute.
    You can easily change the bounds of the picture to catch, as well as the actual contents of it
    HTH,
    Fredrik

  • Append copyright text to copied text in clipboard

    Is it possible in RH6 to append a copyright string to the
    text that a user has just copied to the clipboard, so that when
    they paste it, they get the text they copied, plus the copyright
    string? The old WinHelp application that I am converting to HTML
    help had this feature - I believe the old project was authored in
    RoboHelp, but have no idea on how they included the copyright
    string. I haven't found anything in the help that references
    functionality like this, nor have I found anything online.

    Hi,
    Make use of READ_TEXT and SAVE_TEXT FM to get the additional text and add to the existing text.
    Regards,
    Ankur Parab

  • How to copy data in text file into two-dimensional arrays?

    Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
    import java.io.*;
    import java.util.*;
    public class array
        public static void main (String[] args) throws FileNotFoundException
        { Scanner sc = new Scanner (new FileReader("input.txt"));
            PrintWriter outfile = new PrintWriter("output.txt");
        int[][]matrix = new int[ROWS][COLUMNS];
    }my input.txt :
    a,b,c
    2,2,1
    1,1,1
    2,2,1
    3,3,1
    4,4,1
    5,5,1
    1,6,2
    2,7,2
    3,8,2
    4,9,2
    5,10,2

    import java.io.*;
    import java.util.*;
    public class array {
        public static void main(String[] args) throws IOException {
            FileInputStream in = null;
            FileOutputStream out = null;
    try {
        in = new FileInputStream("input.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line = null;
        while ((line = reader.readLine()) != null) {
            String split[]=line.split(",");
    catch (IOException x) {
        System.err.println(x);
    } finally {
        if (in != null) in.close();
    }}}What after this?

  • Massive copy to system clipboard with vim?

    Say I'm editing a program with vim through a terminal (say xterm). Does anyone know how to copy the contents, via left click highlighting, onto the system clipboard (x11) when the content that needs to be copied is physically off the screen? I've tried to arrow up while highlighting but it doesn't work.

    toxic, from what I understand from t-dawg's questions is that he wants to emulate what you can do in gvim, but with vim instead.
    In gvim, I can click the mouse button; hold; drag downwards and then gvim will start scrolling downwards, whilst highlighting the passing lines. This is how you highlight large amounts of text (greater than what can fit in a single screen at a time) with a mouse.
    However, terminals are slightly dumber. Whilst you can highlight areas of text, that's a console function and not something that vim itself is monitoring. Therefore, you can't achieve the same effect with the mouse in vim as you can in gvim.
    Of course, vim is perfectly capable of selecting more text than can fit in a single screen. It has a visual mode. Press v and then move down with your cursor keys, et volia - highlighted text.
    Now when it comes to shifting this to X11's clipboard, I've never tried (hence the link I gave for possible help). I'm sure it can be done.

  • E71 - Copy text to clipboard from from html reader...

    I could not copy text to clipboard from
    - Web page, html readers,
    - Web feed reader
    - Email reader. (if I choose reply or forward, then I can copy text)
    How to do it?
    is almighty E71 unable to do it?

    U can not even copy link on html reader or
    email address from email reader.
    How can Nokia make such a mistake?
    I think the Nokia programmers are aliens from other planet!!!

  • New to Imac - how do you view the clipboard?

    How do I see the clipboard and have it open?

    Are you saying your clipboard is not refreshing?
    By default the clipboard should refresh every time you copy something. However there are some users that have problems and the clipboard keeps the same data even after copying new text. There is a script you can use to flush clipboard contents.
    Enter the following into the Script Editor in Applications/Utilities
    tell application "System Events" to set the clipboard to ""
    Save as an Application. Put the Script app on your desktop to run.
    FWIW, I recently had this problem after assigning shortcuts to Paste and Match Style. I had to do a PRAM reset followed by a Safe Boot to get my clipboard working again.
    Reset PRAM
      1. Shut down your Mac.
      2. Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
      3. Turn on the computer.
      4. Press and hold the Command-Option-P-R keys before the gray screen appears.
      5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
      6. Release the keys.
    Safe boot
    *  shutdown
    *  start the Mac and *wait* for the startup chime to sound
    *  after the sound, press and hold down the shift key
    *  keep holding and *wait* until the grey  Apple logo appears
    *  now release the shift key and just wait (it could take a few minutes)
    *  eventually the login screen appears with the words SAFE BOOT
    A

  • Copy diagram to clipboard for sql server 2012 the row did not appear when paste in paint

    hello,
    i've been trying to create database diagram on my database on sql server 2012 platform. i can create the diagram, but when copy it to clipboard and try to paste it on paint, only the tables name appear without all the columns name. any idea how can i paste
    it to have information for both tables name and columns name as well.i've no issue creating diagram and paste on paint for my sql server 2008.
    Thanks in advance.
    kneeah

    Hi kneeah,
    According to your description, SQL 2012 database diagram is not printed correctly and several of column names are missed. There are some suggestions for troubleshooting this issue, you can refer to the following steps.
    1. We recommend you can copy database diagram to Word and check if it will print correctly.
    2. When printing database diagrams, several of the tables contain large grey squares instead of the column names. We recommend switch Windows XP computer from Classic theme to Windows XP theme, and check if it can print correctly.
    There is more similar issue about printing database diagram, you can review the following posts.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/267da892-c470-4269-854f-c1327746b16c/problem-with-printing-database-diagrams
    http://forums.asp.net/t/1190828.aspx
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

Maybe you are looking for