MacID Function

Description

Used only on the Macintosh to convert a four-character constant to a value that may be used by Dir, Kill, Shell, and AppActivate.

Syntax

MacID(constant)

The constant named argument consists of four-characters used to specify a resource type, file type, application signature, or Apple Event. For example, TEXT, OBIN, MSWD (Microsoft Word), XCEL (Microsoft Excel), and so on.

Remarks

MacID is used with Dir and Kill to specify a Macintosh file type. Since the Macintosh does not support '*' and '?' as wildcards, you can use a four-character constant instead to identify groups of files. For example, the following statement returns 'TEXT' type files from the current folder:


Dir("", MacID("TEXT"))

MacID is used with Shell and AppActivate to specify an application using the application's unique signature.

See Also

AppActivate Statement, Dir Function, Kill Statement, Shell Function.

Example

This example shows various uses of the MacID function. The MacID function is not available in Microsoft Windows.


' Return the first text file in folder HD:My Folder.
FileName = Dir("HD:My Folder:", MacID("TEXT"))

' Deletes all "TEXT" files in the current folder.
Kill MacID("TEXT")
' Run Microsoft Excel.
ReturnValue = Shell(MacID("XCEL"))

' Activate Microsoft Word.
AppActivate MacID("MSWD")