标签: extendscript

从所选文本生成脚注

我正在尝试使用ExtendScript编写InDesign脚本.我希望脚本剪切选定的文本,插入脚注并将文本粘贴到脚注正文中.我尝试过的:

 function makeFootnoteOfSelection(){
   var fnText = app.activeDocument.selection[0];
         // this should actually clone the selected text, not reference it, because the next statement zaps it from memory
   app.activeDocument.selection[0].remove();  // works
   var fNote = app.activeDocument.selection[0].footnotes.add();  // works, adds an empty footnote with a reference
   fNote.contents = fnText.contents;
         // this replaces the reference number, I was hoping to retain it and just add the text
         // fNote.contents += fnText.contents; also replaces the reference number
}
Run Code Online (Sandbox Code Playgroud)

extendscript adobe-indesign

1
推荐指数
1
解决办法
1994
查看次数

如何通过编码UTF-8将文本写入文件?

我的代码在Adobe Script(.jsx)中将文本写入文件:

 var xml=  " ?????? Pro"

  var file = new File(output);
  file.open("w");   
  file.write(xml);
  file.close();
Run Code Online (Sandbox Code Playgroud)

但是结果编码UTF-8无法显示: ?????? Pro 它只能显示文本 " ?????? Pro",如果设置了文件编码Shift-JIS.

如何通过编码UTF-8将文本写入文件?

extendscript

1
推荐指数
1
解决办法
1581
查看次数

如何从URL下载图像以在Photoshop脚本中使用(ExtendScript Toolkit)

在我的Photoshop javascript(使用ExtendScript工具箱)中,我需要在处理图像之前先下载图像。我正在尝试使用wget,如下所示:

app.system("wget https://dl.dropboxusercontent.com/u/73950/IMG_1827%20%282%29.png > ~/Desktop/test.png");
Run Code Online (Sandbox Code Playgroud)

不幸的是,这会产生一个空的png文件。

用Photoshop编写脚本时从URL下载文件的正确方法是什么?

javascript photoshop extendscript

1
推荐指数
1
解决办法
1059
查看次数

自动批处理脚本-在Photoshop中将文件名转换为文本

如何在Photoshop中将一堆文件的每个文件名转换为文本层(并保存)?

文件夹1:文件混乱

文件夹2:几乎相同的文件,但每个文件的文件名都贴在其图像上

这是被黑客入侵的代码段。我似乎无法解决的错误是如何将activeDocument设置为当前打开的文件。http://pastebin.com/b0fqG9v4

javascript photoshop adobe extendscript flash-cs5

0
推荐指数
1
解决办法
8001
查看次数

在InDesign CS6中选择组内的textFrames

类似于我早先在页面上基于geometryBounds或部分名称查找textFrame的问题,我现在遇到了查找textFrames的问题,如果它们在组内.如果我使用所有textFrames的数组,例如:

var textFramesArray = document.textFrames.everyItem().getElements();
Run Code Online (Sandbox Code Playgroud)

不会找到任何组内的textFrame.如果它在一个组中,我怎样才能弄清楚如何引用textFrame?即使该组必须取消分组,这很好,但我甚至无法弄清楚如何在页面上找到组!

javascript extendscript adobe-indesign

0
推荐指数
1
解决办法
3915
查看次数