0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【photoshop】メニューコマンドスクリプト

Last updated at Posted at 2023-01-16

メモです。見つけ次第増やしていきます。

ツール

var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putClass(app.stringIDToTypeID('TOOLNAME'));
desc.putReference(app.charIDToTypeID('null'), ref);
executeAction(app.charIDToTypeID('slct'), desc, DialogModes.NO); 

TOOLNAMEを以下の項目に変更することで使用できます。

ツール名 TOOLNAME
長方形選択ツール marqueeRectTool
楕円形選択ツール marqueeEllipTool
なげなわツール lassoTool
多角形選択ツール polySelTool
自動選択ツール magicWandTool
コンテンツに応じた移動ツール recomposeSelection
切り抜きツール cropTool
スライスツール sliceTool
スポイトツール eyedropperTool
カラーサンプルツール colorSamplerTool
ブラシツール paintbrushTool
鉛筆ツール pencilTool
消しゴムツール eraserTool
グラデーションツール gradientTool
バケツツール bucketTool
ぼかしツール blurtool
シャープツール sharpenTool
指先ツール smudgeTool
覆い焼きツール dodgeTool
焼き込みツール burnInTool
スポンジツール saturationTool
ペンツール pentool
フリーフォームペンツール freeformPenTool
曲線ペンツール curvaturePenTool
アンカーポイントの追加ツール addKnotTool
アンカーポイントの削除ツール deleteKnotTool
アンカーポイントの切替ツール convertKnotTool
長方形ツール rectangleTool
楕円形ツール ellipseTool
三角形ツール triangleTool
多角形ツール polygonTool
ラインツール lineTool
カスタムシェイプツール customShapeTool
手のひらツール handTool
回転ビューツール rotateTool
ズームツール zoomtool

選択範囲

被写体を選択

var idautoCutout = stringIDToTypeID( "autoCutout" );
    var desc343 = new ActionDescriptor();
    var idsampleAllLayers = stringIDToTypeID( "sampleAllLayers" );
    desc343.putBoolean( idsampleAllLayers, false );
executeAction( idautoCutout, desc343, DialogModes.NO );

段落パネル

左寄せ

var idset = stringIDToTypeID( "set" );
    var desc4128 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref105 = new ActionReference();
        var idproperty = stringIDToTypeID( "property" );
        var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
        ref105.putProperty( idproperty, idparagraphStyle );
        var idtextLayer = stringIDToTypeID( "textLayer" );
        var idordinal = stringIDToTypeID( "ordinal" );
        var idtargetEnum = stringIDToTypeID( "targetEnum" );
        ref105.putEnumerated( idtextLayer, idordinal, idtargetEnum );
    desc4128.putReference( idnull, ref105 );
    var idto = stringIDToTypeID( "to" );
        var desc4129 = new ActionDescriptor();
        var idtextOverrideFeatureName = stringIDToTypeID( "textOverrideFeatureName" );
        desc4129.putInteger( idtextOverrideFeatureName, 808464433 );
        var idalign = stringIDToTypeID( "align" );
        var idalignmentType = stringIDToTypeID( "alignmentType" );
        var idleft = stringIDToTypeID( "left" );
        desc4129.putEnumerated( idalign, idalignmentType, idleft );
    var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
    desc4128.putObject( idto, idparagraphStyle, desc4129 );
executeAction( idset, desc4128, DialogModes.NO );

右寄せ

var idset = stringIDToTypeID( "set" );
    var desc4128 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref105 = new ActionReference();
        var idproperty = stringIDToTypeID( "property" );
        var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
        ref105.putProperty( idproperty, idparagraphStyle );
        var idtextLayer = stringIDToTypeID( "textLayer" );
        var idordinal = stringIDToTypeID( "ordinal" );
        var idtargetEnum = stringIDToTypeID( "targetEnum" );
        ref105.putEnumerated( idtextLayer, idordinal, idtargetEnum );
    desc4128.putReference( idnull, ref105 );
    var idto = stringIDToTypeID( "to" );
        var desc4129 = new ActionDescriptor();
        var idtextOverrideFeatureName = stringIDToTypeID( "textOverrideFeatureName" );
        desc4129.putInteger( idtextOverrideFeatureName, 808464433 );
        var idalign = stringIDToTypeID( "align" );
        var idalignmentType = stringIDToTypeID( "alignmentType" );
        var idleft = stringIDToTypeID( "right" );
        desc4129.putEnumerated( idalign, idalignmentType, idleft );
    var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
    desc4128.putObject( idto, idparagraphStyle, desc4129 );
executeAction( idset, desc4128, DialogModes.NO );

中央寄せ

var idset = stringIDToTypeID( "set" );
    var desc4128 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref105 = new ActionReference();
        var idproperty = stringIDToTypeID( "property" );
        var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
        ref105.putProperty( idproperty, idparagraphStyle );
        var idtextLayer = stringIDToTypeID( "textLayer" );
        var idordinal = stringIDToTypeID( "ordinal" );
        var idtargetEnum = stringIDToTypeID( "targetEnum" );
        ref105.putEnumerated( idtextLayer, idordinal, idtargetEnum );
    desc4128.putReference( idnull, ref105 );
    var idto = stringIDToTypeID( "to" );
        var desc4129 = new ActionDescriptor();
        var idtextOverrideFeatureName = stringIDToTypeID( "textOverrideFeatureName" );
        desc4129.putInteger( idtextOverrideFeatureName, 808464433 );
        var idalign = stringIDToTypeID( "align" );
        var idalignmentType = stringIDToTypeID( "alignmentType" );
        var idleft = stringIDToTypeID( "center" );
        desc4129.putEnumerated( idalign, idalignmentType, idleft );
    var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
    desc4128.putObject( idto, idparagraphStyle, desc4129 );
executeAction( idset, desc4128, DialogModes.NO );
0
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?