[Photoshop Script] アクティブドキュメントをTIFF(ZIP圧縮)で保存

サイズの大きいPSDや、スキャナでスキャンした無圧縮TIFFをZIP圧縮のTIFFで保存するスクリプト。操作を記録して作るアクションではファイル名が決め打ちになってしまい役に立たないので仕方なく書いてみた。
※元がTIFFファイルの場合は上書き保存になります。

// SaveAsTiffZip.js アクティブドキュメントを TIFF(ZIP圧縮)で保存
// 2017.12.31 Mitsuhiro Arita

file_name = master_file_path = app.activeDocument.fullName.fsName.toString();

var file_obj = new File( file_name );
var tif_opt = new TiffSaveOptions();
fileObj = new File( file_name );
tif_opt = new TiffSaveOptions();
tif_opt.alphaChannels = true;
tif_opt.annotations = true;
tif_opt.byteOrder = ByteOrder.IBM;
tif_opt.embedColorProfile = true;
tif_opt.imageCompression = TIFFEncoding.TIFFZIP;
tif_opt.layerCompression = LayerCompression.ZIP;
tif_opt.layers = true;
tif_opt.saveImagePyramid = false;
tif_opt.spotColors = false;
tif_opt.transparency = true;
activeDocument.saveAs(file_obj, tif_opt, true, Extension.LOWERCASE);

var message = "";
message = message + "[" + file_name + "]をTIFFZIPで保存しました\n";

// 確認メッセージ
alert(message);

Leave a Reply

Your email address will not be published. Required fields are marked *