The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Shadow workaround? Thread Tools Search this Thread Display Modes
Bug: Can't reset shadow to immediately beneath object

Workaround: Create different layers and put the graphics in the right layer such that the shadow is cast on the layer.
eg:

Code:
set middleLayer to make new layer at end of layers with properties {name:"middleLayer"}
set imageShape to make new shape at end of graphics of middleLayer with properties {draws shadow:true, size:{218, 150}, origin:{25, 28}, thickness:1, shadow vector:{3, -3}}
-- Can't set image directly in a layer
tell imageShape to set {image} to {"/path/to/image.jpg"}

set backLayer to make new layer at end of layers with properties {name:"backLayer"}
set backShape to make new shape at beginning of graphics of backLayer with properties {draws shadow:false, size:{270, 198}, origin:{0, 0}, thickness:0, fill:"linear blend", fill color:{0.576, 0.576, 0.576}, gradient color:{0.18, 0.18, 0.18}, gradient angle:90, gradient center:{-1, -1}}
And now the shadow from the image appears on the background shape.

Issues: You can't put the graphics into a group to manipulate them further, and similar cross-layer issues, but at least they look correct.

Thoughts?
 
I think you might be overlooking the Shadow inspector. There you can control whether objects' shadows fall on lower layers (the default) or on all lower objects, including those on lower layers. (If you're wondering why there is a distinction: in many cases people want to compose something out of multiple shapes, and having their shadows interplay prevents the desired composition.) Hopefully I'm correctly interpreting the issue you're trying to work around.
 
Yes, the inspector can be used to do it manually, but the shadow settings can't be set from Applescript (hence the post in this forum, rather than Omnigraffle General). Unless I've missed it, and if so, please let me know the property name to set shadow placement :)

Many thanks for the response.
 
Quote:
Originally Posted by azaroth42 View Post
Yes, the inspector can be used to do it manually, but the shadow settings can't be set from Applescript (hence the post in this forum, rather than Omnigraffle General). Unless I've missed it, and if so, please let me know the property name to set shadow placement :)

Many thanks for the response.
The property is called "shadow vector". I quickly found this by dragging a circle onto the canvas, setting the shadow offset to {+17, +17}, then using Edit->Copy As->AppleScript and pasting the results into a text file which I searched for "17":

Code:
tell application "OmniGraffle Professional"
	tell canvas of front window
		make new shape at end of graphics with properties {name: "Circle", textSize: {0.800000, 0.700000}, size: {133.000000, 107.000000}, origin: {128.000000, 236.000000}, textPosition: {0.100000, 0.150000}, shadow vector: {17.000000, 17.000000}}
	end tell
end tell
Hope that helps!
 
Quote:
Originally Posted by Ken Case View Post
The property is called "shadow vector".
Hi Ken,

Thanks for the response! I'm obviously not being very clear about the issue. What I'm trying to do is, as per Andrew's manual suggestion, reset the shadow to be drawn on the object directly beneath the shadowed object.

The difference between the buttons in the UI:
* Shadow immediately beneath this object [this is what I want]
* Shadow behind all other objects in the same layer [but this is the default]

Sorry for the confusion.
 
Quote:
Originally Posted by azaroth42 View Post
What I'm trying to do is, as per Andrew's manual suggestion, reset the shadow to be drawn on the object directly beneath the shadowed object.
My apologies, I clearly wasn't reading carefully enough!

The bad news is that I looked into this in more depth and you're right: there's currently no good way to set that property from AppleScript. The only workarounds that come to mind are to copy your shape from one which already has the property set, or to use UI scripting to script the Inspector.

The good news is that an upcoming release of OmniGraffle will add a new "shadow beneath" scripting property to shapes.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need suggestions for tags workaround AEG Colorado OmniFocus 1 for Mac 5 2013-04-24 11:42 AM
New Keychain Behavior in Mac OS X 10.8? [A: bug in 10.8 - see thread for workaround.] chmars OmniFocus 1 for Mac 4 2012-09-26 01:18 PM
Am I on the right track? Tags workaround. Penguin OmniFocus 1 for Mac 13 2010-10-07 02:53 AM
Why do some projects appear dropped? [sync bug with workaround] callekula OmniFocus Syncing 1 2009-07-22 12:38 PM


All times are GMT -8. The time now is 10:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.