My intent is to be able to detect if a selected object has a fill opacity set to less than 100.
In the dictionary, I could not figure out how to target which property of item 1 of a selection to obtain the opacity value? Any insight would be greatly appreciated, even if it is help to where I should be looking.
I suppose I have another question? How can get AS to display all the properties of a selected item.
Obviously this does not work.
tell application "Adobe InDesign CS4"
activate
tell document 1
set sel to selection
set theProps to properties of item 1 of sel
display dialog theProps as string
end tell
end tell
I figured others may benefit from what I figured out, so why not post what I came up with?
This will display the opacity of a selected object, then it will display the blending mode of a selected object.
I am also having it test for the fill color first, since I am only concerned with items filled with “Black” swatch.
tell application "Adobe InDesign CS4"
set theSelection to selection
tell document 1
set theItem to item 1 of selection
set theFill to fill color of theItem
if theFill is swatch "Black" then
set theOpac to opacity of blending settings of transparency settings of theItem
display dialog theOpac as string
set theBlend to blend mode of blending settings of transparency settings of theItem
display dialog theBlend as string
end if
end tell
end tell
Brilliant.
Thanks for posting this ” I’ve been trying for the last 15 minutes to work this exact same problem out for CS5.
I got as far as :
return properties of transparency settings of selection
Not realising I needed to go one level further :
return properties of blending settings of transparency settings of selection
You just saved me from an aneurysm. :-)+)
d.