是否可以使用Indesign javascript调用Web服务? [英] Is it possible to call a web service with Indesign javascript?

查看:97
本文介绍了是否可以使用Indesign javascript调用Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一家印刷公司的内部开发人员。

I'm an in-house developer for a print company.

我们使用Adobe Indesign CS3和CS5创建打印文档。

We use Adobe Indesign CS3 and CS5 to create documents for printing.

我在Adobe Extendscript中创建了一个脚本,该脚本创建了一个Indesign文档,并在客户端自行完成时处理一些基本的转换。

I created a script in Adobe Extendscript that creates an Indesign Document and handles some basic conversions when the client fails to do so themselves.

我使用Javascript来编写这个脚本。

I used Javascript to write this script.

是否可以通过这样的脚本调用Web服务?

Is it possible to call a web service through such a script?

如果是这样,怎么做?

如果没有,那么从桌面调用网络服务的最佳方法是什么?

If not, what would be the best way to call a web service from the desktop?

谢谢。

推荐答案

否和是。

不,没有办法(afaik)让InDesign从脚本调用Web服务。这很可能并且经常从InDesign插件中完成(您可以执行任意c ++代码,以便您可以执行任何操作)。然而,这是一个完全不同的野兽要学习。

No, there is no way (afaik) to make InDesign call a web service from a script. It's very possible and often done from InDesign plugins (you can execute arbitrary c++ code so you can do whatever). However, that's an entirely different beast to learn.

是的,可以使用库从ExtendScript中完成。因此,基本上您的脚本会调用Web服务来获取数据(可能使用从InDesign或文档中获取的参数),然后将返回的值发送到其他InDesign脚本函数中以执行操作。

Yes, it's possible to do from ExtendScript using a library. So basically your script would call the web service to get data (maybe using parameters gotten from InDesign or the document) and then send the returned values into other InDesign script functions to perform the operations.

可以在这里找到基本样本使用'Extendables'。

A basic sample can be found here that uses 'Extendables'.

编辑:因为似乎有些混乱:文件不是运行脚本的文件,甚至很少包含他们。脚本以InDesign特定的Javascript格式(.jsx)保存,并由InDesign脚本引擎解释。

Since there seem to be some confusion: The documents aren't the ones running the script and very rarely even contain them. The scripts are saved in an InDesign specific Javascript format (.jsx) and interpreted by the InDesign scripting engine.

这篇关于是否可以使用Indesign javascript调用Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆