Syntax
MacID$(Identifier$)
Remarks
On the Macintosh, converts an application signature or a file type to a value that can be used with instructions (such as AppClose, Files$(), or Shell) that require either an application filename or a file type. In Windows, MacID$() is not available and generates an error.
MacID$() provides a way to specify an application without specifying the application filename, which the user can change. MacID$() can be used to specify an application with the following instructions: AppActivate, AppClose, AppCount, AppGetNames, AppGetNames(), AppIsRunning(), Shell.
MacID$() can be used with Files$(), FileOpen, and Kill to specify a Macintosh file type. Because the Macintosh does not support the MS-DOS asterisk (*) and question mark (?) wildcard characters, you use a file type to identify groups of files. For example, the following statement returns a text filename from the current folder:
textfile1$ = Files$(MacID$("TEXT"))
Note
You cannot specify multiple files in a specific folder by concatenating a path and a MacID$() file type. For example, the following instruction produces unexpected results:
textfile1$ = Files$("HD:TEXT FILES:" + MacID$("TEXT"))
Instead, you use a ChDir instruction to change the current folder, and then use MacID$() in an instruction to specify a file type.
Argument | Explanation | |
Identifier$ | An application signature or file type. An application signature is a four-character sequence that uniquely identifies an application. For example, MSWD is the application signature for Word; XCEL is the application signature for Microsoft Excel. A file type is a four-character sequence that identifies a file format. For example, W6BN is the file type for files created by Microsoft Word 6.0 for the Macintosh and TEXT is the file type for text files (and files created in Windows, such as Word 6.0 for Windows files). You can use "****" to indicate all files in a folder. Note that application signatures and file types are case sensitive. For example, "MSWD" is the application signature for Word, but "Mswd" is not. For a given filename, you can use FileCreator$() to determine the signature of the application that created the file, and you can use FileType$() to determine the file type. |
Examples
This example uses MacID$() with AppIsRunning() and Shell to determine whether Microsoft Excel is running and to start Microsoft Excel if it is not running.
If AppIsRunning(MacID$("XCEL")) = 0 Then Shell MacID$("XCEL")
The following example uses MacID$() with FileOpen to display the Open dialog box and list the Word templates in the current folder.
Dim FOdlg as FileOpen GetCurValues FOdlg FOdlg.Name = MacID$("WTBN") choice= Dialog(FOdlg) If choice = -1 Then FileOpen FOdlg
The following example uses MacID$() with Files$() to insert a list of text files in the current folder into the active window:
textfilename$ = Files$(MacID$("TEXT")) While textfilename$ <> "" Insert textfilename$ textfilename$ = Files$() InsertPara Wend
See Also
AppActivate, AppClose, AppCount(), AppGetNames, AppIsRunning(), FileCreator$(), FileOpen, Files$(), FileType$(), Kill, SetFileCreatorAndType, Shell