Name

Location Manager

Syntax

tell app "Location Manager"
   set curApp to current location (* set a variable to location returned 
   by "current location" property *)
end tell

Dictionary classes

application

This class represents the Location Manager program:

tell app "Location Manager" to launch

The application has one or more location objects as elements. To examine one of these objects, use code such as:

tell app "Location Manager" to get location
1

See the location class later in this chapter. The Location Manager application also has one property, current location.

The following are application elements:

location

If you use Location Manager to set several different configurations (which is what it is designed for), then each configuration or location is accessible as a location element. This code example gets the name of each location and displays the names in a dialog window:

set locs to "The location names are: " & return
   tell application "Location Manager"
   repeat with ct from 1 to (count location)
      set locs to locs & (name of location ct) & return
   end repeat
   display dialog locs
end tell

The following are application properties:

current location location

This current location property returns the currently active location. It is a settable property; see the Examples section at the end of this chapter.

location

This class represents a location you can create with Location Manager. A location is a set of system configurations such as file sharing, TCP/IP, and Extension sets, among other ...

Get AppleScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.