#automation Articles


Quick Column Scripting

Occasionally, I get requests for new features that are very simple, and might take longer to deploy in the code base than it would take to make them available through AppleScript. In many of these cases, over the years, I've gone ahead and written and distributed AppleScript to meet these needs. A couple of days ago, a user reached out needing st set a specific column in new rows to a particular value. The general case of this requires providing a way to choose the column to be set, the value to be set, and which rows to set it …

Saving Time by Using AppleScript

AppleScript can make life much easier when performing repetitive tasks. Recently we had an issue with a customer needing to automate the Count Points in Polygons tool across a number of point layers. The process was taking a long time due to the sheer number of point layers being aggregated. To automate the process we wrote a script that will count points from multiple point layers and automatically add new data fields to the polygon layer. The new data fields will be labeled to match the name of the point layer being aggregated. Here, I'll show an example of this …

Summarizing Point Data on a Polygon Layer

Occasionally it is necessary to summarize the data from a layer of points based on containment within a polygon layer. This article presents a relatively straightforward way to do this with Cartographica. The solution to this problem requires the use of both an internal command and a small AppleScript, which we will provide. This simple script can be modified for your individual needs to apply basically any formula, but in the example case, it provides the sum of the values of a single column in the point dataset. At the end of this piece, we'll discuss some easy adaptations of …

Importing KML Description data in Cartographica

Those of you importing KML data files may have been surprised when the Description comes in with all sorts of "field data" that you think might belong in columns. Unfortunately, there are a number of different ways to represent actual field data in KML and seeing only the Description and Name fields imported by Cartographica is an excellent sign that the maker of the KML file didn't use any of them. However, we have an AppleScript you can use to mine that data inside of Cartographica. For those unfamiliar with AppleScript, we had some more in-depth commentary on it in …

AppleScript changes in 1.2.2

Although AppleScript is probably not one of the most used features of Cartographica, it's quickly becoming one of the most powerful. Since the first release of Cartographica, we have supported using the Macintosh built-in scripting system to manipulate information in Cartographica. If you're new to AppleScript or an old hand, we think some of the improvements we've made to 1.2.2 are big news. Here are some of the things we've done for 1.2.2: Increased support for analysis functions We've added support for a number of previously-unavailable analysis functions to the Cartographica AppleScript dictionary. Now you can …

Advanced label techniques in Cartographica

Cartographica contains some powerful features, but there are times when you need to combine things that aren't obviously available in current versions. One such situation came up with a customer who was interested in combining two or more fields to create a label. Although future versions will likely have ways to do simple label combinations, we wanted to show how you can use AppleScript and Cartographica today to make labels that not only combine the contents of more than one field, but that do so in ways that provide extra flexibility. Because some of the techniques used in this post …