Script to manipulate contents of clipboard

Hi there,

I'm a total newbie and would like some help. I'd like to have a script to

  • load the contents of the clipboard into a variable
  • manipulate the variable by adding the characters /* to the beginning of every line and */ to the end of every line
  • load the variable back into the clipboard.

Thanks in advance for any help / advice on this.

Are you screen scraping? Which language are you using?
After you have loaded the variable back into the clipboard (even if that is possible), what do you intend to do with it?

I wanted to assign a shortcut in a third party program that would do the following:

  • copy highlighted text to clipboard
  • run a unix script that would prefix each line in the clipboard with the characters "/* "
  • paste the new contents of the clipboard back to the program

The third-party program itself does not have the functionality to insert the characters but can run unix scripts.

Height of scripting imagination :D:D