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 > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
AppleScript: Unit Scale and Boolean Operations Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
This request has two parts.

I am trying to write a script which, given a few parameters, will create a series of shapes and perform boolean operations on them (intersect, subtract, etc.)

On top of this I'm trying to use the Unit Scale of the document so the end user can provide a value in feet, but I don't see how/if it's exposed via AppleScript. So for now I'm hard-coding it into the script, i.e.

Code:
set unitscale_left to 1 -- the inches
set unitscale_right to 12 -- the feet -- i.e. 1" = 12' in this case
set scale_dpi to 72
set unit_scale to scale_dpi / unitscale_right * unitscale_left -- i.e. 6 in this case
Using this unit_scale conversion factor, I create two shapes. (Let's say a square and a circle.) In my script, I've kept references to the two shapes as they're returned from OmniGraffle Pro.

So far, when I've created primitives, I have been able to use "Copy As Applescript" from the Edit menu in order to see how to reproduce them from a scripting standpoint. However, if I intersect the two shapes manually, I get an object with a crazy-long gibberish name:

Code:
make new shape at end of graphics with properties {name: "1F527F65-F94B-4590-BEFC-0C41E495370B-14690-0000C3313DE014D4", ...
Is there a way to cleanly use AppleScript to ask OmniGraffle Pro to intersect two items?

If not, I'm guessing I would need to 'do it by hand', or:

- Tell the app / window / document / canvas (whatever) to set selected of each of those items to true (or whatever; I don't know the exact syntax here)

- Do something with... menu item "Intersect Shapes" of menu "Shapes" of menu item "Shapes" of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process "OmniGraffle Professional" of application "System Events"?

Thanks!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unit Scale and copy and pasting of elements spl72 OmniGraffle General 0 2011-10-24 08:08 PM
Can't do operations on items selected in list view Leon Starr OmniGraffle General 1 2008-06-23 10:04 AM
Boolean operations Pascal Harris OmniGraffle General 4 2008-05-30 09:34 AM
Unit conversions in AppleScript dmw OmniGraffle General 0 2007-03-27 12:16 PM
Feature unrequest - automatic change of scale unit in Gantt chart gillesp OmniPlan General 0 2006-09-27 03:57 PM


All times are GMT -8. The time now is 07:53 AM.


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