我发现了app.paste()命令,但它并不返回字符串,它只是粘贴到文档文本中。基本上,我需要命令,返回剪贴板!
http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf
http://prntscr.com/cg5qtb
发布于 2017-09-07 15:23:35
我认为Illustrator中没有返回剪贴板数据的命令。如果要在不同应用程序之间复制粘贴,可以使用app.copy()和app.paste();如果只想在Illustrator中使用,可以使用Illustrator文档中提供的duplicate方法。
发布于 2020-05-31 02:07:57
app.paste()会使它创建的新图层成为唯一选定的图层,因此您可以通过返回文本的.contents属性来访问文本内容,如下所示:
#target illustrator
function getClipboard() {
var doc = app.activeDocument;
var clipboard = '';
app.paste();
clipboard = doc.selection[0].contents;
doc.selection[0].remove();
return clipboard;
}
function main() {
alert( getClipboard() );
}
main();```https://stackoverflow.com/questions/39419206
复制相似问题