accessing clipboard/pasteboard

40 views
Skip to first unread message

bryan

unread,
Jun 2, 2013, 11:34:00 AM6/2/13
to js...@googlegroups.com
Hi,

I have to work with the clipboard (windows, linux), and pasteboard on mac.

Anyone have any examples of working with these with jsdb?

Suggestions for how to do it?

I guess linux - figure out if I am in X or terminal mode (other modes?) run xclip or gpm using execute?

Do similar for clipboard in windows.

execute for pbcopy in mac.

Does this seem right or wrong headed? Smarter way to do it?

Thanks,
Bryan Rasmussen



Shanti Rao

unread,
Jun 3, 2013, 12:46:34 AM6/3/13
to js...@googlegroups.com
Hi Bryan,

The sensible thing would be to have functions like system.clipboardCopy() and system.clipboardPaste(). If you can find some code snippets for copying/pasting UCS-2 or UTF-8 text, I'll add them. (I finally fixed my GCC problem, so an update to JSDB is in the works).

Shanti

bryan rasmussen

unread,
Jun 3, 2013, 4:18:45 AM6/3/13
to js...@googlegroups.com
That would change between systems, and also how low level you wanted it?

For example if it was linux then it would be different depending on what gui you had, and also different for the terminal (depending on how hacky you wanted to do it)

for example if you have X then you use xclip, in the terminal you might use gpm, etc. etc.

On mac you would use pasteboard NSPasteboard,

on windows I can't recall at the moment but it's not that important because windows working with the clipboard is the easiest.

But this is all based on doing it the 'right' way, which I was thinking to do it the hacky way, that is to do a execute to get clipboard info and then just branch on what I had to execute based on OS.

The reason why I would prefer this is I don't actually see any difference in the result for my usecase, which is to get text If I am wanting to access smart clipboard content, like fragments of html it would have to be pretty complicated.

The hacky way is what node-copy-past does https://github.com/xavi-/node-copy-paste although it gets extra hacky by using a vbscript to access the windows clipboard and pipe it back.





--
You received this message because you are subscribed to the Google Groups "JSDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsdb+uns...@googlegroups.com.
To post to this group, send email to js...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsdb?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages