Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 07-04-2017, 11:05 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default Feature Request - Clipboard functions in the API

When I'm writing on stuff in Reaper, I always find one thing missing very much: The chance to put or get values from the Clipboard using Lua, so I'd love to ask for these two functions:

value GetClipboard(type)
Gets data from the clipboard of the system

type - is the type of "media" to get from the clipboard. Standard is text.
value - is the returned text(string), or an audio/picture-object.


bool PutToClipboard(object[, type])
Puts data to the clipboard of the system. Returns true, if it worked.

object - the data to put to the clipboard (string, mediaitem, etc)
type - is the type of "media" to put to the clipboard. Standard is text.

Last edited by Meo-Ada Mespotine; 07-04-2017 at 11:37 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-04-2017, 09:55 PM   #2
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

I while back I wanted this function as well. I can no longer remember why though . You never know.

+1
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 07-04-2017, 10:31 PM   #3
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Clipboard API would be very useful. For now there are workarounds using OS-dependent tools: https://forum.cockos.com/showthread.php?p=1789851.

EDIT: I submitted a patch to add a text clipboard API in SWS: https://github.com/reaper-oss/sws/pull/876. Binaries at http://files.cfillion.tk/sws/clipboard-api/.

Last edited by cfillion; 07-05-2017 at 01:34 AM.
cfillion is offline   Reply With Quote
Old 07-05-2017, 08:52 AM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@cfillion
Very nice !

It was something I requested some times ago !

Copy-Cut-Paste Text to/from Clipboard Actions - Cockos Incorporated Forums - Projects

I want to make a rename active take from clipboard action :P
X-Raym is offline   Reply With Quote
Old 07-08-2017, 11:47 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@cfillion

Cool...that's a great addition

@airon
Copy and Paste for textboxes written in Lua(like lokasenna's gfx-library), or pasting pictures in the clipboard into a gfx-buffer for further use...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-05-2017, 01:49 PM   #6
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Thanks!

Could the size of the buffer be set automatically for reaper.CF_GetClipboard?

Code:
CF_GetClipboard(char *buf, int bufSize)
Quote:
Originally Posted by cfillion View Post
Clipboard API would be very useful. For now there are workarounds using OS-dependent tools: https://forum.cockos.com/showthread.php?p=1789851.

EDIT: I submitted a patch to add a text clipboard API in SWS: https://github.com/reaper-oss/sws/pull/876. Binaries at http://files.cfillion.tk/sws/clipboard-api/.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 08-09-2017, 02:58 PM   #7
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Using Lua it's just clipboard = reaper.CF_GetClipboard(). REAPER takes care of buf and buf_sz behind the scene.
cfillion is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.