【发布时间】:2015-12-09 23:51:04
【问题描述】:
我是 ExtendScript、Basil.js 和 Javascript 的新手。
在看到http://basiljs.ch/gallery/ending-the-depression-through-amazon/ 项目后,我想知道是否可以简单地让 Basil.js 脚本/Extendscript/Indesign 从网页中抓取图像并将其直接插入到 indesign 文档中。
我是一个初学者,所以如果有人有一个完整的脚本,从目录、函数......带有示例 url、导入、保存、放置......?
这是希望我可以简单地在脚本中输入一个地址,它会收集网页上的所有图像并将它们放入一个indesign文档中?
我试过他们的例子http://basiljs.ch/tutorials/getting-images-from-urls/ 但是当我复制它并在扩展脚本中运行它时,它只是在搜索我的计算机......
更新*
#includepath "~/Documents/;%USERPROFILE%Documents";
#include "basil/basil.js";
function draw() {
var url = "https://raw.github.com/basiljs/basil.js/master/lib/basil.png";
// download the url to a default location, filename according to url:
// -> "the project folder" + data/download/basil.png
//b.download(url);
// download url to a specific location in the project folder:
// -> "the project folder" + data/download_images_files/basil_logo.png
// b.download(url, "download_images_files/basil_logo.png");
// download url to a specific location e.g. to your desktop
// -> ~/Desktop/basil_logo.png
var newFile = new File("~/Desktop/basil_logo.png");
b.download(url, newFile);
}
b.go();
...它在 Basil 的 Core.js 中发现错误 @
var runDrawOnce = function() {
app.doScript(function() {
if (typeof glob.draw === 'function') {
glob.draw();
}
}, ScriptLanguage.javascript, undef, UndoModes.ENTIRE_SCRIPT);
};
控制台说... 使用 basil.js 1.08 ... sh ~/Documents/basiljs/bundle/lib/download.sh /Users/jamestk/Desktop (地址在这里,我在堆栈溢出方面没有足够的声誉)
Basil.js 错误 -> b.shellExecute(): 错误: sh: /Users/jamestk/Documents/basiljs/bundle/lib/download.sh: 没有这样的文件或目录
【问题讨论】:
-
向我们展示您的尝试和结果。
-
如果您想自动化该过程,您将需要所有图片 url 的列表。 Basil 无法为您施展魔法并为您抓取整个页面。
-
使用图像的 URL 与常规添加图像的优势是什么?Ziki 我添加了我在上面所做的。我打开 indesign 并将脚本复制到扩展脚本中,注释掉位置我不想使用...
-
@James.TK 你关注了installation guide
-
不....我跳过它...因为... :S :P
标签: adobe-indesign extendscript basil.js