15.3. Example Scripts

This section contains some simple examples of what can be done with AppleScript scripting and Cartographica.

Example 15.1. Setting a column value for all Features in a Layer

tell application "Cartographica"
	set targetlayer to layer "Businesses" of the first document
	repeat with aFeature in every feature of targetlayer
		set value of field data "Copyright" of aFeature to "© 2010, ClueTrust"
	end repeat
end tell
      

The example above demonstrates cycling through every feature in the targetLayer (in this case a layer with the name "Businesses") and setting a value of the data field named "Copyright" to ©2010, ClueTrust.

There are further example scripts on the ClueTrust Support site if you search for AppleScript