Anyone here successfully stroke an image using AppleScript or knows how to do it?
So far I have
tell application "Adobe Photoshop CS"
activate
set artLayerRef to make new eart layer in docRef
set name of artLayerRef to "tDoc"
set kind of artLayerRef to etxt layer
set current layer of current document to layer "tLayer" of current docuemtn
set stroke color of tDoc to {class:RGB color, red:255, blue:255}
end tell
any suggestions on how to make this work? right now i’m getting the error: “The variable docRef is not defined” ??
You have to instantiate a variable with the name “docRef”. You need something like:
set docRef to current document
From reading the code that you have it appears that you want to apply a stroke to some type. Is this correct?
If so, “set stroke color” will not work. I did some testing and “stroke color” is actually a property of a text object that determines the text’s color (kinda like “fill” for text).
The only way to stroke text in Photoshop via applescript (that I have found) is to apply a layer style that you have created (and saved) using the Styles palette. I have found no way to directly manipulate layer styles using applescript.
Using the basic framework of your code I came up with this:
tell application "Adobe Photoshop CS"
activate
tell current document
set artLayerRef to make new art layer
set name of artLayerRef to "tDoc"
set kind of artLayerRef to text layer
set current layer to artLayerRef
--enter some text for the newly created text layer and add it to the layer
set textForLayer to text returned of (display dialog "Enter some text for this Layer:" default answer "")
set contents of text object of artLayerRef to textForLayer
set size of text object of artLayerRef to 20 -- so you can see it (makes the type 20 points)
apply layer style artLayerRef using "1 Px stroke 100% Fill Opacity" -- this is a layer style that comes with Photoshop. You can use your own that you have made using the Styles palette.
end tell
end tell
Hope this helps