PhotoShop - 记录PS的所有操作为JavaScript代码

本文介绍如何在Adobe Photoshop中使用ScriptListener插件记录操作,通过JavaScript自动保存操作步骤,便于复用和学习。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[size=large]PS中是可以运用JavaScript编写脚本的,关于这部分请参见:[/size]
[list]
[*][url]http://developer.51cto.com/art/201309/411886_all.htm[/url]
[*][url]http://bbs.cfan.com.cn/thread-1398326-1-1.html[/url]
[/list]
[list]
[*]一些示例(保存为jpg文件等)[url]http://www.tranberry.com/photoshop/photoshop_scripting/tips/photoshopforgeeks2.html[/url]
[*]官方文档[url]http://www.adobe.com/devnet/photoshop/scripting.html[/url]
[*]官方例程请在官方文档页面搜索 Sample files
[/list]


[size=large]这里要说的是如何记录我们在PS中的操作呢?毕竟手工编写脚本很累,而且好多操作不一定会啊!!
Adobe为我们提供了一个叫做[color=red]ScriptListener.8li[/color]的插件,用了它,所有PS中的行为都会被记录成JavaScript和VBScript!!Photoshop自动生成JavaScript代码的感觉是不是很爽呢?想想还有些小激动呢!

可惜,,事物都有两面性,,这家伙生成的代码真心不是给人看的,,看看下面的代码,猜猜他的作用吧!![/size]
// =======================================================打开文件
var idOpn = charIDToTypeID( "Opn " );
var desc1 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc1.putPath( idnull, new File( "C:\\Users\\XX\\Desktop\\original-image.jpg" ) );
executeAction( idOpn, desc1, DialogModes.NO );

// =======================================================调整曲线
var idMk = charIDToTypeID( "Mk " );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
ref1.putClass( idAdjL );
desc2.putReference( idnull, ref1 );
var idUsng = charIDToTypeID( "Usng" );
var desc3 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var desc4 = new ActionDescriptor();
var idpresetKind = stringIDToTypeID( "presetKind" );
var idpresetKindType = stringIDToTypeID( "presetKindType" );
var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
desc4.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
var idCrvs = charIDToTypeID( "Crvs" );
desc3.putObject( idType, idCrvs, desc4 );
var idAdjL = charIDToTypeID( "AdjL" );
desc2.putObject( idUsng, idAdjL, desc3 );
executeAction( idMk, desc2, DialogModes.NO );


[size=large]没错,我只是打开了一幅图片,调整了一下曲线!!!
不多说了,,实在没辙时还是得靠他啊!![/size]


[size=xx-large][color=blue]ScriptListener.8li的下载、安装和使用[/color][/size]
[size=large]1、下载[/size]
[url]http://www.adobe.com/devnet/photoshop/scripting.html[/url]
下载[color=red]Scripting Listener Plug-in for Windows[/color]
或者 在这篇文件的附件中也有哈!!
[img]http://dl2.iteye.com/upload/attachment/0095/9256/2e1acfdc-772b-30b2-9d34-36443489f1ef.png[/img]

[size=large]2、安装[/size]
[size=large]将下载的文件中的[color=red]ScriptListener.8li[/color]复制到
PS安装目录下的Adobe Photoshop CC (64 Bit)\Plug-ins 文件夹中[/size]
[img]http://dl2.iteye.com/upload/attachment/0095/9262/c86e8cb6-7b1c-3c2d-8b21-5587f86abf4e.png[/img]

[size=large]3、使用[/size]
[size=large]经过了以上两步,无论您在PS中做啥,都会被记录!!!
如前所述,JavaScript的记录保存在[color=red]桌面[/color]上的[color=red]ScriptingListenerJS.log[/color]文件中[/size]

[size=large]4、建议[/size]
[size=large]这玩意儿平时用不到还是不要安装的好!!!用时再拷贝到Plug-ins目录下即可!![/size]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值