零点参考线、缩放选定图层、透明像素裁切
This commit is contained in:
1 parent
58155f32d6
commit
6a800280d4
3 files changed
+175
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#target photoshop
|
||||
|
||||
/*
|
||||
Trim transparent pixels on all four sides.
|
||||
|
||||
Equivalent Photoshop command:
|
||||
Image > Trim...
|
||||
Based On: Transparent Pixels
|
||||
Trim Away: Top, Bottom, Left, Right
|
||||
*/
|
||||
|
||||
(function () {
|
||||
if (app.documents.length === 0) {
|
||||
alert("没有打开的文档。请打开一个文档后再运行此脚本。");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
app.activeDocument.trim(
|
||||
TrimType.TRANSPARENT,
|
||||
true, // Top
|
||||
true, // Left
|
||||
true, // Bottom
|
||||
true // Right
|
||||
);
|
||||
} catch (error) {
|
||||
alert("Trim failed:\n" + error.message);
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in new issue
Block a user