利用cmd发送数据到剪切板
本帖最后由 qxlonmsn 于 2022-5-19 10:02 编辑(defun SET-CLIP-STRING (strlst / wj vlr-dwg-reactor_new vlr-dxf-reactor_new deletefile)
(vl-load-com)
(if (and
(vl-consp strlst);strlst是表且不为nil
(setq strlst (mapcar 'vl-princ-to-string strlst));全部转字符串
(setq wj (open "d:/剪切板数据.txt" "w"));打开临时文件
);end and
(progn
(princ "\n")
(foreach n strlst
(write-line n wj)
(princ "\n")
(princ n)
);end foreach
(startapp "cmd /c clip <d:/剪切板数据.txt");文本内容复制到剪切板
(close wj)
;(vl-file-delete "d:/剪切板数据.txt");删掉文件就粘贴不了
(princ "\n数据已发送到剪切板!\n数据存储位置==>d:/剪切板数据.txt")
(princ)
);end progn
);end if
);发送字符串str到剪切板
感谢分享源码! 感谢分享源码 感谢分享源码{:1_12:}
页:
[1]