Applescript to create Visio like rack space tool
"Chris Inacio" <[email protected]>
| Newsgroups | gmane.comp.graphics.omnigraffle.user |
|---|---|
| Message-ID | <[email protected]> |
I am interested in what would be necessary to support Visio like operation
of building racks of components. I have a Visio file a workmate sent me and
if I hover over some items, it gives me information such as:
Switch
Height: 7
Height in U's: 4
I then copy and pasted this item as AppleScript to take a look and it
contains a lot more information in the applescript to reproduce the shape,
including Height in U's, etc.:
tell application "OmniGraffle Professional"
tell canvas of front window
make new shape at end of graphics with properties {textSize: {0.614755,
0.342945}, user data: {Height in U's: "4", Height: "7"}, draws stroke:
false, thickness: 0.1, fill: no fill, gradient center: {-0.500000,
-0.500000}, textPosition: {1.100000, 0.328527}, origin: {72.600006,
329.100006}, vertical padding: 0, notes: {text: "Switch", text: "Switch"},
size: {114.000000, 42.000000}, text: {text: "XXX XXXX", color: {0.000000,
0.000000, 0.000000}, font: "ArialMT", text: "XXX XXXX"}, side padding: 0,
gradient color: {0.752941, 0.752941, 0.752941}, draws shadow: false}
make new shape at end of graphics with properties {user data: {Asset Number:
"0", Manufacturer: "0", Network Description: "0", SubShapeType: "Switch",
ShapeType: "Device", Building: "0", Product Number: "0", Community String:
"0", Network Name: "0", Height in U's: "2", IP Address: "0", Room: "0",
Subnet Mask: "0", Administrative Interface: "0", MAC Address: "0", Product
Description: "0", Part Number: "0", Location: "0", Height: "3.5", Number of
Ports: "0", Power Usage: "0", ShapeClass: "RackEquipment", Serial Number:
"0"}, draws stroke: false, thickness: 0.72, fill: no fill, gradient center:
{0.500000, -0.500000}, origin: {27.038506, 329.100006}, vertical padding: 0,
size: {22.761499, 42.000000}, text: {text: "4 U", color: {0.000000,
0.000000, 0.000000}, font: "ArialMT", text: "4 U", alignment: right}, side
padding: 0, gradient color: {0.752941, 0.752941, 0.752941}, draws shadow:
false}
I deleted most of the Applescript, it was a lot more of the same.
So the question is, do any of the Applescript experts out there think it
would be feasible to build something that can understand U height in
Omnigraffle? I can program in a bunch of different languages, so I'm
willing to tackle it; I just don't have a lot of time to invest in something
that will just end up not being feasible. I know that I can at least use
AppleScript to start inserting information into my OmniGraffle objects that
will make it keep working as expected in Visio, and at a minimum I would
like to do that.
So expert feedback would be greatly appreciated.
thank you,
Chris Inacio