如何使用Adobe bridge和c#创建缩略图
本文关键字:创建 略图 何使用 Adobe bridge | 更新日期: 2023-09-27 17:51:01
是否有使用c#控制台应用程序与Adobe bridge通信的方法?
我想为给定的图像文件夹创建缩略图(例如:SamplePictures)使用桥..
我知道桥支持java脚本,有没有办法用JavaScript编程桥..
流程如下:
-
Run Bridge SDK
-
查找创建缩略图的方法
-
通过JScript调用方法
-
从JScript调用c#
引用
-
Adobe Photoshop JavaScript脚本参考
-
如何从JScript.net调用c#
-
使用应用程序间通信开发应用程序
-
c#编译器如何检测COM类型?
-
在没有类型库的情况下使用c#中的COM dll
编程Bridge的唯一方法是使用任何Adobe的产品,包括com, Photoshop, Indesign, Illustrator等,通过com使用BridgeTalk。下面是一个获取所选Bridge文件列表的示例。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
namespace Bridge
{
class Program
{
[STAThread]
static void Main(string[] args)
{
dynamic app = Activator.CreateInstance(Type.GetTypeFromProgID("Photoshop.Application"));
//Get list of select files from Bridge
String Code = "var fileList;" +
"var bt = new BridgeTalk();" +
"bt.target = 'bridge';" +
"bt.body = 'var theFiles = photoshop.getBridgeFileListForAutomateCommand();theFiles.toSource();';" +
"bt.onResult = function( inBT ) { fileList = eval( inBT.body ); }" +
"bt.onError = function( inBT ) { fileList = new Array(); }" +
"bt.send(8);" +
"if ( undefined == fileList ) {" +
"fileList = new Array();}" +
"fileList = decodeURI(fileList.toString());";
String RC = app.DoJavaScript(Code, null, null);
ArrayList list = new ArrayList();
list.AddRange(RC.Split(new char[] { ',' }));
for (int index = 0; index < list.Count; index++)
{
Console.WriteLine(list[index]);
}
Console.ReadLine();
}
}
}