Adobe .jsx脚本可以包含其他脚本文件吗? [英] Can Adobe .jsx scripts include other script files?

查看:109
本文介绍了Adobe .jsx脚本可以包含其他脚本文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在编写一堆.jsx脚本,在每个脚本中我都必须模拟一些函数,以便可以使用Array.map()和String.trim()之类的东西,但我不想这样做在每个脚本的顶部包含该代码。

We're writing a bunch of .jsx scripts and in each I have to mock out some functions so I can use things like Array.map() and String.trim(), but I don't want to have to include that code at the top of every script.

是否可以将其他.jsx脚本包含到.jsx脚本文件中?

Is there a way to "include" other .jsx scripts inside of a .jsx script file?

推荐答案

或者您可以简单地使用 #include #includepath 预处理程序指令位于脚本顶部。
您可以在 Adob​​e的 JavaScript工具指南 中找到详细的说明。 。

Or you can simply use #include and #includepath preprocessor directives at the top of your script. You can find a detailed description in Adobe's "JavaScript Tools Guide".

例如,如果要在中包含 scripts / helper.jsx .jsx 文件:

For example, if you want to include scripts/helper.jsx in a .jsx file:

#include "scripts/helpers.jsx"
// the rest of your code below ...

这篇关于Adobe .jsx脚本可以包含其他脚本文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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