The script below (actually it’s a subroutine) works fine on OS X but skips or ignores parts of it on OS 9. The subroutine is a part of a droplet. The variables passed are :
theChoice: “limited” or “restricted”
tempFolderPath: just a folder on the desktop named “tempFolder”
thisFile: alias to the file dropped on the droplet
I also think I am using a lot more code than needed to change the text layer properties but I couldn’t seem to set all the properties on one line. (set properties of text object of art layer theLetter to {LIST O PROPERTIES HERE} didn’t seem to work.)
on EditImage(theChoice, tempFolderPath, thisFile)
if theChoice = “Limited” then
set theLetter to “L”
else
set theLetter to “R”
end if
tell application "Adobe Photoshop 7.0"
activate
close every document saving ask
open thisFile
tell front document
set theWidth to width
set theHeight to height
--make new layer
make new art layer at beginning with properties {name:"Black Box"}
--select layer and make selection for icon box, fill selection
set current layer to art layer "Black Box"
select region {{theWidth - 75, theHeight - 75}, {theWidth - 75, theHeight}, {theWidth, theHeight}, {theWidth, theHeight - 75}} combination type replaced
fill selection with contents {class:RGB color, red:0.0, green:0.0, blue:0.0} opacity 100 without preserving transparency
--making text layer for letter icon and setting properties
make new art layer at beginning with properties {kind:text layer, name:theLetter}
set contents of text object of art layer theLetter to theLetter
set size of text object of art layer theLetter to 48
set font of text object of art layer theLetter to "Arial-Bold"
if theChoice = "Limited" then
set stroke color of text object of art layer theLetter to {class:RGB color, red:255.0, green:255.0, blue:102.0}
set position of text object of art layer theLetter to {theWidth - 52, theHeight - 25}
else
set stroke color of text object of art layer theLetter to {class:RGB color, red:204.0, green:51.0, blue:51.0}
set position of text object of art layer theLetter to {theWidth - 55, theHeight - 25}
end if
--making new text layer for usage word
make new art layer at beginning with properties {kind:text layer, name:theChoice}
set contents of text object of art layer theChoice to theChoice
set font of text object of art layer theChoice to "Arial-Bold"
set size of text object of art layer theChoice to 12
set position of text object of art layer theChoice to {theWidth - 70, theHeight - 5}
if theChoice = "Limited" then
set stroke color of text object of art layer theChoice to {class:RGB color, red:255.0, green:255.0, blue:102.0}
set tracking of text object of art layer theChoice to 290
else
set stroke color of text object of art layer theChoice to {class:RGB color, red:204.0, green:51.0, blue:51.0}
set tracking of text object of art layer theChoice to 90
end if
set myOptions to {class:JPEG save options, embed color profile:false, format options:standard, matte:background color matte}
save in tempFolderPath as JPEG appending lowercase extension with myOptions and copying
close saving no
end tell
end tell
end EditImage