<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Turns out objc:make-nsstring is a built-in function now, so you can just do this:<div><br></div><div><div>(defun write-to-clipboard (string)</div><div> (let ((pb (#/generalPasteboard ns:ns-pasteboard)))</div><div> (#/clearContents pb)</div><div> (objc:with-autorelease-pool</div><div> (#/writeObjects: pb (#/initWithObject:</div><div> (#/alloc ns:ns-array)</div><div> (objc:make-nsstring string))))))</div></div><div><br><div><div>On Dec 22, 2014, at 11:14 AM, Ron Garret <<a href="mailto:ron@flownet.com">ron@flownet.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Try this:<div><br></div><div><div>(defun write-to-clipboard (string)</div><div> (let* ((pb (#/generalPasteboard ns:ns-pasteboard))</div><div> (nsstr (with-encoded-cstrs :utf-8 ((s string))</div><div> (#/stringWithUTF8String: ns:ns-string s)))</div><div> (objects (#/initWithObject: (#/alloc ns:ns-array) nsstr)))</div><div> (#/clearContents pb)</div><div> (#/writeObjects: pb objects)))</div><div><br></div><div>Notes:</div><div><br></div><div>1. This probably leaks memory.</div><div>2. You’re supposed to be able to write (make-instance ’ns:ns-array :with-object nsstr) instead of (#/initWithObject: (#/alloc ns:ns-array) nsstr) but it doesn’t work. I’m pretty sure this is a CCL bug. I’ve filed a ticket.</div><div><br></div><div><br></div><div><div>On Dec 21, 2014, at 9:15 AM, Steven Núñez <<a href="mailto:sales@illation.com">sales@illation.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>Has anyone out there had an opportunity to integrate or drive the recently open-source Omni
<a href="https://github.com/graphsketcher/GraphSketcher">GraphSketcher</a> application from CCL? I’m brushing up on my statistics and find that while GraphSketcher does an adequate job of displaying plots while doing experiments, its method of handling data
imports is a bit clumsy. You have to copy & paste data into it, which typically means a workflow of: generate CSV file -> open CSV file -> copy data -> go to GraphSketcher -> paste data</div>
<div><br>
</div>
<div>This should be easier. Even being able to drag a data file would be simpler, but sadly that’s not available in GraphSketcher. I thought about modifying GraphSketcher, but ObjectiveC/Xcode/Coding Signing path seems too steep to justify the return, and I
want to see if there a way to get at this application from the CCL side.</div>
<div><br>
</div>
<div>One of the quickest ways I suppose would be to write my output data directly to the clipboard, so that I then need just go to GraphSketcher and paste it. Does anyone have any examples of this in CCL? Something like (with-clipboard …) analogous to the (with-open-file
…) macro would be a handy thing to have.</div>
<div><br>
</div>
<div>Regards,</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>- Steve</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
_______________________________________________<br>Openmcl-devel mailing list<br><a href="mailto:Openmcl-devel@clozure.com">Openmcl-devel@clozure.com</a><br><a href="https://lists.clozure.com/mailman/listinfo/openmcl-devel">https://lists.clozure.com/mailman/listinfo/openmcl-devel</a><br></blockquote></div><br></div></div>_______________________________________________<br>Openmcl-devel mailing list<br><a href="mailto:Openmcl-devel@clozure.com">Openmcl-devel@clozure.com</a><br>https://lists.clozure.com/mailman/listinfo/openmcl-devel<br></blockquote></div><br></div></body></html>