![]() In order to receive an upgrade discount, you’ll need to purchase the new application in the same store that you purchased the earlier version from. For subscriptions purchased directly from Omniĭiscounts are available for customers who purchased an earlier version of our Mac apps.Managing or cancelling your Subscription.Activating (or reactivating) features on another device.The screenshots below use OmniPlan for illustration purposes, but the same steps are applicable to users purchasing OmniFocus, OmniGraffle, or OmniOutliner. I’m not much more fond of JavaScript than I am of AppleScript, and I especially dislike writing AppleScript-flavored JavaScript.The buying options and purchasing process detailed in this article is the same for all of our paid applications. I feel certain there’s a magical incantation that will get the set reds to every shape whose… command to work.īut please don’t tell me to use Omni’s cross-platform JavaScript system. If you know what I could have done to simplify this script, I’m all ears. So why the need for as list? I don’t know, but the counts came out zero without it. Script Debugger told me the value of t was list. In fact, when I added a debugging line to the top of repeat loop, applescript: ![]() I shouldn’t have to tell AppleScript to treat c as a list-it is a list. When I first wrote it, these lines looked like applescript:Īfter all, fColors is a list of lists, so each item of fColors is a list. Lines 15, 18, and 21 all have the same form: applescript: Because the point of this exercise was to get counts, not investigate every nook and cranny of AppleScript and the OmniGraffle dictionary, I added the inelegant repeat loop and got on with life.īut even the repeat loop didn’t work out the way I first thought it would. I tried several variations, but came up empty (literally) every time. The script ran, but the lists came out with lengths of zero. ![]() The result, stored in the variable fColors, is a list of lists that looks like this: Īnd then I’d just see how long the reds, greens, and blues lists were. Lines 8–12 get a list of all the colors of all the circles in the “Annotations” layer. Lines 4–6 then initialize the counts for the different colors. (I had made the OmniGraffle document with two layers, one for the floor plan and one for all my circle annotations.) Get fill color of shape 1 of layer "Annotations" of canvas 1 of document 1 I figured out the values by running AppleScript lines like applescript: You’ll note that the individual components aren’t limited to the usual 8-bit 0–255 range, they seem to use a 16-bit range of 0–65,535. Lines 1–3 define the RGB triplets for the three different colors I used for the circles. Here’s what I ended up with: applescript:ĩ: tell layer "Annotations" of canvas 1 of document 1ġ0: set fColors to fill color of every shape whose name is "Circle" AppleScript bashed back, but eventually I won. OmniGraffle for the Mac has an AppleScript dictionary, so I girded my loins, opened up Script Debugger, and started bashing away. So I figured the best way to do the counting and recounting was to write a script to do it. And because drawings often don’t reflect what was actually built, I had reason to believe I’d be modifying the annotations after visiting the building, which means I’d have to redo the counts. I wanted the counts of the different features, which is the sort of thing that a child can do, but which an adult is likely to screw up (this adult, anyway). When I was done, it looked sort of like this with red, green, and blue circles scattered over the drawing: 1 I had imported a floor plan into OmniGraffle and marked it up with translucent circles, using different colors for different features of interest. This morning I had a fight with AppleScript and thought you might be interested in the blow-by-blow. Next post Previous post Counting and colors in OmniGraffle and AppleScript
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |