Here are the events discussed in this section:
Purpose:
Get reference [ as list of typeclass ]
The parameter reference is the object whose data is to be returned. The parameter typeclass is the desired types for the data, in order of preference.
Purpose:
Set reference to anything
The parameter reference is the object whose data is to be changed. The parameter anything is the new value for the object.
tell application "CodeWarrior IDE" to
set numClasses to the count of classes
Purpose:
Queries the location(s) of a globally-scoped function or data object for the current project.
Get Definition string
The string is the name of the symbol you are interested in.
Returns:
Record containing a list of the function information.
Listing 0.21 Example for Get Definition
Get Definition "main"
Purpose:
Gets a list of all the member functions of a class object.
Get Member Function Names reference
List containing the information.
Listing 0.22 Example for Get Member Function Names
Get Member Function Names class "CPowerTelnetApp"
Purpose:
Gets a list of all the member functions of a class object.
Get Nonsimple Classes
List containing the information.
Listing 0.23 Example for Get Nonsimple Classes
Get Nonsimple Classes class "CPowerTelnetApp"
Purpose:
Gets the list of open documents.
Get Open Documents
List of documents in records of type 'docu'. See Table A.40 for more information
Purpose:
Get Preferences [ of pref-list ] from panel panel-name
The panel-name must be the name of the preference panel file and not the name
that appears in the preferences window. For example, to set C/C++
Language options, use "C/C++ Compiler" as the panel-name and not "C/C++ Language".
Returns:
Record containing a list of the requested preferences. If you do not include pref-list, it returns all the preferences for panel-name.
Listing 0.24 Examples for Get Preferences
Get Preferences from panel "C/C++ Compiler"
Get Preferences of {File Name, SIZE Flags} ¬
from panel "PPC Project"
Purpose:
Specifies the settings for a panel.
Set Preferences of panel panel-name to record
Performs the equivalent of setting options using either the Preferences or Settings windows. This event lets you set the properties of the current project. It is not necessary to specify every preference, those not mentioned in the record retain their settings. The properties for different panels are listed in various tables from Table A.3 to Table A.38.
The panel-name must be the name of the preference panel file and not the name
that appears in the preferences window. For example, to set C/C++
Language options, set panel-name to "C/C++ Compiler" and not "C/C++ Language".
Returns:
Listing 0.25 Examples for Set Preferences
Set Preferences of panel "PPC Project" to { ¬
File Name:"MyProgram", File Creator:"Mine", SIZE Flags:23008 ¬
}
Set Preferences of panel "C/C++ Compiler" to { ¬
Prefix File: "MacHeaders", ¬
Activate CPlusPlus: TRUE, ¬
Require Function Prototypes: FALSE ¬
}
Set Preferences of panel "C/C++ Warnings" to { ¬
Extended Error Checking: TRUE ¬
}
Purpose:
Gets information on a project entry.
Get Project File file-number segment seg-number
The information of the specified entry in the current project
as a record of type 'SrcF'. The file-number parameter specifies a file within its segment or group. The seg-number parameter specifies a segment or group within the project. Numbering
for both parameters are short integers beginning at 1.
Listing 0.26 Examples for Get Project File
get project file 1 segment 1 -- First entry in project get project file 1 segment 2 -- First entry in 2nd segment
Purpose:
Sets information on a project entry.
Set Project File filename to record
Changes the settings for the specified entry in the open project.
The record parameter is of type 'SrcF'. Only the symbols and weak link fields are allowed. Listing A.28 shows how to set weak linking for a library InterfaceLib that is in a project.
Returns:
Listing 0.27 Example for Set Project File
Set Project File "InterfaceLib" to {weak link: true}
Purpose:
Sets the current target for a project.
Set Current Target name-of-target
This AppleEvent causes the build target to change. This event would be useful when changing the build target in a project, so that a new target can be built or otherwise operated on with other AppleEvents. To learn more information about setting the current build target, refer to the IDE User Guide.
Returns:
Listing 0.28 Example for Set Current Target
Set Current Target "Muscle 68K"
Purpose:
Set Default Project name-of-target
This AppleEvent causes the default project to change. To learn more information about setting a default project, refer to the IDE User Guide.
Returns:
Listing 0.29 Example for Set Default Project
Set Current Project "Muscle.mcp"
Purpose:
Gets the filename of the project.
Get Project Specifier
The name of the current project.
Purpose:
Gets the descriptions of all segments/groups in the open project.
Get Segments
List of documents in records of type 'Seg '. Refer to "Segment" for more information
Purpose:
Sets preferences for the current project.
Set Segment number to record
Sets information for a segment or group in the open project. Segment
numbering starts at 1. The record parameter is an object of type 'Seg '. Listing A.31 shows how to rename a segment/group in a project. Refer to "Segment" for more information.
Returns:
Listing 0.30 Example for Set Segment
Set Segment 1 to {name:"New Sources"}
Purpose:
Are the specified file(s) are in the project?
Is In Project filename
Replaces filename with a single filename or a list of filenames.
Returns:
A list of errors. The result code for each specified file can have the following values:
Listing 0.31 Examples for Is In Project
Is In Project "SillyBalls.c"
Is In Project { "SillyBalls.c", "Initialize.c" }
Purpose:
Resets access paths for all files belonging to the open project.
Reset File Paths
Purpose:
Closes an object. The saving and saving in parameters are optional, and have the range of values listed
here.
Close reference [ saving yes/no/ask ] [ saving in alias ]
Purpose:
Counts the number of elements within an object.
Count reference each type class
An integer indicating the number of elements.
Purpose:
Makes a new element. The as list of, as, with data, and with properties parameters are optional, and have the range of values listed
here.
Make new [ as list of type class ] [ at location reference ] [ with data anything ] [ with properties record ]
A reference to the new object(s).