feat: AI套图分层方案 + Gemini集成 - 4种图案类型处理 + 正片叠底 + 宽高比 + 模型选择
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24
PSMARK代码块/存储psd.jsx
Normal file
24
PSMARK代码块/存储psd.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
function saveAsPSD(saveFolder) {
|
||||
var doc = app.activeDocument; // 获取当前文档
|
||||
|
||||
if (doc == null) {
|
||||
alert("没有打开的文档!");
|
||||
return;
|
||||
}
|
||||
|
||||
var fileName = doc.name.replace(/\.[^\.]+$/, ''); // 移除文件扩展名
|
||||
var saveFile = File(saveFolder + "/" + fileName + ".psd"); // 创建保存路径
|
||||
|
||||
var d = new ActionDescriptor();
|
||||
var d1 = new ActionDescriptor();
|
||||
d1.putBoolean(stringIDToTypeID("maximizeCompatibility"), true);
|
||||
d.putObject(stringIDToTypeID("as"), stringIDToTypeID("photoshop35Format"), d1);
|
||||
d.putPath(stringIDToTypeID("in"), new File(saveFile));
|
||||
d.putInteger(stringIDToTypeID("documentID"), 2027);
|
||||
d.putBoolean(stringIDToTypeID("lowerCase"), true);
|
||||
d.putEnumerated(stringIDToTypeID("saveStage"), stringIDToTypeID("saveStageType"), stringIDToTypeID("saveSucceeded"));
|
||||
executeAction(stringIDToTypeID("save"), d, DialogModes.NO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user