Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Finder Guide /
Chapter 2 - Finder Objects / Object Class Definitions


Font Suitcase

An object of class Font Suitcase is a suitcase file that contains font information.

PROPERTIES
A font suitcase has all the properties defined for object class Container on page 42: Completely Expanded, Container Window, Entire Contents, Expandable, Expanded, Previous List View, Selection, and View.

Like any other container, a font suitcase also has all the properties defined for object class Item on page 72: Bounds, Comment, Container, Content Space, Creation Date, Disk, Folder, Icon, ID, Information Window, Kind, Label Index, Modification Date, Name, Physical Size, Position, Selected, Size, and Window.

ELEMENT CLASSES
Items within a font suitcase can be identified by name or by number. For more information, see the definition of object class Item on page 72.

COMMANDS HANDLED
Clean Up, Close, Copy, Count, Data Size, Delete, Duplicate, Exists, Get, Move, Open, Put Away, Reveal, Select, Sort, Update

DEFAULT VALUE CLASS RETURNED
A reference to a suitcase or, if you use the plural form font suitcases, a list of references.

EXAMPLE
The script that follows moves a font suitcase called Janson Text into or out of the Fonts folder, first asking the user to confirm the move. (If you are using version 1.1 of the Finder scripting software, a second dialog box appears when the Finder is moving suitcases into the Fonts folder, warning the user that the suitcases won't be available to running applications right away.)

tell application "Finder"
   activate
   set x to name of items in fonts folder
   if "Janson Text" is in x then
      set response to display dialog �
         "Remove the Janson fonts from the System?"
      if button returned of response is "OK" then
         move font suitcase "Janson Text" of fonts folder to �
            folder "Font Storage" of startup disk
      end if
   else
      set response to display dialog �
         "Move the Janson fonts into the System?"
      if button returned of response is "OK" then
         move font suitcase "Janson Text" �
            of folder "Font Storage" of startup disk to fonts folder
      end if
   end if
end tell 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996