Photoshop:如何在 Photoshop 中从另一个 JSX 脚本运行/调用 JSX 脚本?

发布于 2024-09-30 05:03:00 字数 273 浏览 6 评论 0原文

我在一个 JSX 脚本中有变量和字符串,我想在 Photoshop 的另一个 JSX 脚本中使用它们。

我想在第二个脚本中重新运行第一个脚本,并以这种方式获取变量。我该怎么做?

更多详细信息:我正在使用第一个脚本并正在操作该脚本中的数字。当我完成工作时,我希望另一个脚本能够获取这些数字并对这些变量执行一些计算,并提示我它们,以便我可以将其复制粘贴到我在其他地方使用它的地方。

这是我在 Stack 上的第一篇文章,我已经在这个网站上找到了大量的信息,这真的很棒,感谢这里的每个人:)

I have variables and strings in one JSX script that I would like to use in another JSX script in Photoshop.

I wanted to just re-run the first script in the second, and get the variables in there that way. How do I do this?

More details: I am using the first script and am manipulating numbers in that script. When I have finalized my work, I would like for another script to take those numbers and perform some calculations on those variables and prompt me with them so I can copy paste it where I am using it elsewhere.

This is my first post at Stack, I have found tons of information on this site already, it's really great, thanks to everyone here :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

短暂陪伴 2024-10-07 05:03:00

我通过更多谷歌搜索找到了解决方案。在这里回答:http://forums.adobe.com/thread/555016

这就是它看起来像我。由于我只需要运行一个脚本,因此我将其他内容注释掉了。

var SCRIPTS_FOLDER =  decodeURI(app.path + '/' + localize("$$/ScriptingSupport/InstalledScripts=Presets/Scripts"));
var geo_dynamic = File(SCRIPTS_FOLDER + "/geo_dynamic.jsx");
//var Script2 = File(SCRIPTS_FOLDER + "/Script2.jsx");
//var Script3 = File(SCRIPTS_FOLDER + "/Script3.jsx");
$.evalFile (geo_dynamic);
//$.evalFile (Script2);
//$.evalFile (Script3);

这有点超出我的想象,但它确实有效。有趣的是,做这么简单的事情却这么复杂!在我开始的 Perl 脚本中,我发现在 Perl 中这要容易得多。

I found the solution with some more googling. Answer here: http://forums.adobe.com/thread/555016

And this is what it looks like for me. Since I only need to run one script I have the other stuff commented out.

var SCRIPTS_FOLDER =  decodeURI(app.path + '/' + localize("$$/ScriptingSupport/InstalledScripts=Presets/Scripts"));
var geo_dynamic = File(SCRIPTS_FOLDER + "/geo_dynamic.jsx");
//var Script2 = File(SCRIPTS_FOLDER + "/Script2.jsx");
//var Script3 = File(SCRIPTS_FOLDER + "/Script3.jsx");
$.evalFile (geo_dynamic);
//$.evalFile (Script2);
//$.evalFile (Script3);

This is a bit over my head but it works. It's interesting it is this complicated to do something so simple! In my beginning perl scripts I have found this to much much easier in perl.

嗼ふ静 2024-10-07 05:03:00

我刚刚找到了导入另一个 jsx 的更好解决方案。
非常简单,只需添加这一行即可:

#include "path/to/file.jsx"

之后您可以使用导入的 jsx 的任何方法。

一个例子:

#include "path/to/file.jsx"
foreign_method();

I have just found a better solution to import another jsx.
It´s really simple, just put this line and that´s all:

#include "path/to/file.jsx"

After that you can use any method of the imported jsx.

An example:

#include "path/to/file.jsx"
foreign_method();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文