Applescriptで操作するAdobe Photoshop5 [Photoshopスクリプト]
フォトショップでテキストを扱う方法
tell application "Adobe Photoshop CC 2019" activate make new document with properties {name:"Hello, World!", mode:RGB, width:200, height:120} tell current document make new art layer with properties {kind:text layer} tell current layer tell text object set contents to "Hello, World!" set position to {1 as inches, 1 as inches} set justification to left set stroke color to {class:RGB color, red:255, green:0, blue:0} set size to 40 end tell end tell end tell end tell
|
新しくドキュメントを作って
テキストレイヤーというアートレイヤを追加。
Hello, World!というテキストを、左上から1インチ離れたところに、赤い文字で、40ポイントの大きさで
作成するものです。
以下のスクリプトも同じ動作をします。
どのやり方が良いか臨機応変に使っていきましょう。
tell application "Adobe Photoshop CC 2019" activate set document1 to make new document with properties {name:"Hello, World!", mode:RGB, width:200, height:120} set textLayer to make new art layer of document1 with properties {kind:text layer} set contents of text object of textLayer to "Hello, World!" set position of text object of textLayer to {1 as inches, 1 as inches} set justification of text object of textLayer to left set size of text object of textLayer to 40 set stroke color of text object of textLayer to ¬ {class:RGB color, red:255, green:0, blue:0} end tell
|
tell application "Adobe Photoshop CC 2019" activate set document1 to make new document with properties {name:"Hello, World!", mode:RGB, width:200, height:120} set textLayer to make new art layer of document1 with properties {kind:text layer} set properties of text object of textLayer to ¬ {contents:"Hello, World!", position:{1 as inches, 1 as inches}, justification:left, stroke color:{class:RGB color, red:255, green:0, blue:0}, size:40} end tell
|
コメント 0