Go Back   Cockos Incorporated Forums > REAPER Forums > newbieland

Reply
 
Thread Tools Display Modes
Old 02-03-2018, 06:37 AM   #1
curtdusoleil
Human being with feelings
 
Join Date: Jan 2018
Posts: 51
Default LUA script to copy text to clipboard

I am a total noob to LUA.

I need a script that will just copy a file path as text to the clipboard. That's it. I absolutely cannot figure it out. I keep getting the error:

attempt to call a nil value (global 'set_clipboard')

Here is the file path I am trying to copy to the clipboard:

D:\_Google Drive\_Acting\VO\Room Tone\roomtone.wav


This must be a simple script, right?
curtdusoleil is offline   Reply With Quote
Old 02-03-2018, 06:40 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Where did you get this set_clipboard from?

If you have SWS 2.9.5+ you can use my function CF_SetClipboard:

Code:
reaper.CF_SetClipboard([[D:\_Google Drive\_Acting\VO\Room Tone\roomtone.wav]])
cfillion is offline   Reply With Quote
Old 02-03-2018, 12:46 PM   #3
curtdusoleil
Human being with feelings
 
Join Date: Jan 2018
Posts: 51
Default Still erroring

Thanks for the quick reply, but I'm still getting an error message with that code:

invalid escape sequence near '"D:\_'
curtdusoleil is offline   Reply With Quote
Old 02-03-2018, 04:06 PM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Quote:
Originally Posted by curtdusoleil View Post
invalid escape sequence near '"D:\_'
You appear to have added quotes (") to the code. Use [[ ]] like I did or escape the backslashes.
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:54 PM.


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