| TOP | UP: Reference | NEXT: Apple Event Suites |
For the coercion verbs, see Table 10-1. For UserTalk keywords, see Part II, UserTalk Basics. For the core, misc, and required verbs, see Chapter 47, Apple Event Suites.
Verbs are listed here in alphabetical order, single-element verbs followed by double-element verbs.
appleEvent (appID,type,subtype,name1,value1,...)
appleEvent (appID,type,subtype,table,...)
appleEvent (appID,type,subtype,record,...)
Sends to the process specified by appID an Apple event of type type and subtype subtype. The name-value pairs that are the parameters of the Apple event may be expressed in any of three ways: a name parameter followed by a value parameter, a table, or a record. These methods of expression may be combined.
The values in the name-value pairs are sent with whatever datatype they actually have; if binary, the internal datatype is used. The type, subtype, and the names in the name-value pairs must be string4s.
appID may be either the process's string4 creator code or its string name, or, if the process is remote, either the binary that is returned from sys.browseNetwork() or a case-sensitive network address string of the form " zone: machine ID:- processName" (where zone can be "*" to signify the local zone).
If appID is 0 the Apple event will be directed to the system.
callXCMD (addrBinary, [param1, param2...])
Calls an XCMD. addrBinary must point to a binary of internal datatype 'XCMD' or 'XFCN'. The other parameters are strings expected as parameters by the XCMD.
close (addrObject)
If the object at addrObject is a non-scalar whose edit window is open, closes the window, also returning to the default target situation if the object was the target. Otherwise, returns false and does nothing.
complexEvent (addr,appID,type,subtype,name1,value1,...)
complexEvent (addr,appID,type,subtype,table,...)
complexEvent (addr,appID,type,subtype,record,...)
Identical to calling appleEvent(), but the result returned from the other application goes into a table of name-value pairs at addr.
defined (objectReference)
Special form. Returns a boolean saying whether the object objectReference exists. An object exists if it has a value, even if that value was not explicitly assigned (i.e., it might be nil). Never raises an error.
delete (addrObject)
If addrObject is an array specifier, removes the specified item from the array. Otherwise, destroys the object at addrObject.
displayString (value)
If value is a binary or a datatype that can be represented by a literal in UserTalk, returns a string consisting of the characters you would have to type in a UserTalk expression to represent value as a literal. Otherwise, returns the result of coercing value to a string.
If value is a string4 and is the value of an object in the current scope, returns the name of that object.
edit (addrObject)
If the object at addrObject is a non-scalar, explicitly declares it to be the target, opening its edit window visibly and making it frontmost. If the object is a scalar, explicitly declares its parent table to be the target, opening its edit window visibly and making it frontmost, and selecting the entry representing the object.
finderEvent (appID,type,subtype,name1,value1,...)
finderEvent (appID,type,subtype,table,...)
finderEvent (appID,type,subtype,record,...)
Identical to calling appleEvent(), but returns immediately without waiting for a response.
gestalt (selector)
Returns the result of calling the Gestalt Manager with string4 parameter selector. Knowing what information can be obtained from the Gestalt Manager, and how to interpret the results, is up to you.
mod (dividend, divisor)
Returns the integer remainder when the integer dividend is divided by integer divisor. It is a runtime error if dividend or divisor is not an integer.
msg (string)
Displays string (which is coerced to a string) in the Main Window message area. If string is "", returns control of the Main Window message area to the agent currently selected in the Main Window popup.
nameOf (objectReference)
Special form. If objectReference is a defined object with a name, such as an item of a record or a table entry or a variable, returns that name as a string; otherwise, returns the empty string. The name of a table entry is its name within its table, not a path. Never raises an error.
new (datatype, addrObject)
Creates an object at addrObject whose value is the result of coercing nil to datatype. If the object at addrObject already exists, its old value is lost.
pack (value, addrDest)
Coerces value to a binary, setting its internal datatype to the datatype of value, and stores the result in the object at addrDest.
parentOf (objectReference)
Special form. Returns the address of the table of which objectReference is an entry; if there is no such table,1 returns the empty string. Never raises an error.
random (integer1, integer2)
Returns a pseudo-random integer between integer1 and integer2 inclusive.
rollBeachball ()
Changes Frontier's cursor to a rolling beachball. Needs to be called at least twice to have an effect. If successive calls occur within 10 ticks of each other, then the rolling beachball cursor persists only until the calls cease. If successive calls occur more than 10 ticks apart, then the rolling beachball persists until execution ceases. The frequency of calls has no effect upon the speed at which the beachball rolls.
getBinaryType (addrBinary, string4)
Sets the internal datatype of the binary at addrBinary to string4.
setEventInteraction (boolean)
Causes any subsequent call to appleEvent(), complexEvent(), tableEvent() or transactionEvent() within this thread to have associated with it an event interaction value of boolean. The default value is true.
setEventTimeout (seconds)
Causes any subsequent call to appleEvent(), complexEvent(), tableEvent() or transactionEvent() within this thread to have associated with it a timeout value of seconds seconds. The default value (infinity) is restored when the thread expires or setEventTimeout(-1) is called.
setEventTransactionID (transID)
Causes any subsequent call to appleEvent(), complexEvent(), or table-Event() within this thread to be transmuted before sending to a transactionEvent() call with a transID value of transID. This situation remains in effect until the thread expires or setEventTransactionID(0) is called.
sizeOf (objRef)
Special form. If objRef refers to an array, returns the number of items in the array. If it refers to an outline, script, or menubar, returns the number of lines. If it refers to a wptext, returns the number of characters. Otherwise, returns the storage space (in bytes) occupied by objRef.
systemEvent (type,subtype,name1,value1,...)
systemEvent (type,subtype,table,...)
systemEvent (type,subtype,record,...)
tableEvent (addrTable,addr,appID,type,subtype,
tableEvent (addrTable,addr,appID,type,subtype,table,...)
tableEvent (addrTable,addr,appID,type,subtype,record,...)
Identical to calling complexEvent(), but addrTable points to a table to be used for some or all of the input name-value pairs.
timeCreated (addrObject)
If the object at addrObject is a non-scalar, returns the date when it was created; if it is a scalar, returns false.
timeModified (addrObject)
If the object at addrObject is a non-scalar, returns the date when it was last modified; if it is a scalar, returns false.
transactionEvent (appID,type,subtype,transID,
transactionEvent (appID,type,subtype,transID,table,...)
transactionEvent (appID,type,subtype,transID,record,...)
Identical to calling appleEvent(), but the transaction ID transID proves to the target process that we have permission to speak to it during this transaction. Rarely called directly; see setEventTransaction().
unpack (addrSource, addrDest)
Coerces the binary value at addrSource into that binary's internal type, and stores the result in the object at addrDest.
app.clearNetworkApp ()
Deletes app.idNetworkApp, to signal that the next time app.startWithDocument() is called, it should launch the local copy of the application, and make the glue table's addressee application be the local copy.
app.linkToNetworkApp (remoteID)
Sets app.idNetworkApp to remoteID, to signal that the next time app.startWithDocument() is called, it should make the glue table's addressee application be the remote process specified by remoteID.
app.start (glueTableName)
Calls app.startWithDocument() with a second parameter of nil. Normally, there is no need to call app.start() directly, but it might be necessary to call it if a glue table has no launch() script, as a way of changing the glue table's addressee application.
app.startWithDocument (glueTableName, docPathname)
Checks app.idNetworkApp to see if we are to address a remote application. If so, copies app.idNetworkApp into the id entry of the glue table in system.verbs.apps named glueTableName ; if not, copies the glue table's appInfo.id into its id entry. This sets the glue table's addressee application. Launches the application specified by id if it is not running, telling it to open the file at docPathname if it is not the empty string (or nil). Normally, should not be called directly: either a glue table's launch() script or app.start() will call it for you.
bit.clear (longInteger, whatBit)
Returns longInteger with its bit whatBit cleared to 0; whatBit is between 0 and 31, where 0 is the low-order bit.
bit.get (longInteger, whatBit)
Returns true or false as longInteger 's bit whatBit is 1 or 0; whatBit is between 0 and 31, where 0 is the low-order bit.
bit.set (longInteger, whatBit)
Returns longInteger with its bit whatBit set to 1; whatBit is between 0 and 31, where 0 is the low-order bit.
card.getObjectEnabled (objectName)
Returns a boolean saying whether the object named objectName in the current card is enabled.
card.getObjectFlag (objectName)
Returns the boolean status of the object named objectName in the current card. The boolean status of a radio button or check box is true if it is highlighted or checked, false if not. The boolean status of an ordinary button is whether it is the default button or not.
card.getObjectText (objectName)
Returns the text of the object named objectName in the current card. The text of a button is its title. The text of a text field, whether user-editable or not, is the text in the field.
card.getObjectVisible (objectName)
Returns a boolean saying whether the object named objectName in the current card is visible.
card.popup.getCheckedItem (objectName)
Returns the number of the currently chosen menu item of the popup menu named objectName in the current card.
card.popup.getHasLabel (objectName)
Returns a boolean saying whether the label of the popup menu named objectName in the current card is visible.
card.popup.getMenu (objectName)
Returns the menu item list of the popup menu named objectName in the current card. A menu item list is a string of menu item names separated by semicolons. A separator line is indicated by a hyphen.
card.popup.getSelectedText (objectName)
Returns the name of the currently chosen menu item of the popup menu named objectName in the current card.
card.popup.setCheckedItem (objectName, itemNumber)
Causes the menu item whose number is itemNumber of the popup menu named objectName in the current card to become the currently chosen menu item.
card.popup.setHasLabel (objectName, visible?)
Shows or hides the label of the popup menu named objectName in the current card, depending on the boolean visible?.
card.popup.setMenu (objectName, string)
Sets the menu item list of the popup menu named objectName in the current card to string. A menu item list is a string of menu item names separated by semicolons. A separator line is indicated by a hyphen.
card.popup.setSelectedText (objectName, itemText)
Causes the menu item whose name is itemText of the popup menu named objectName in the current card to become the currently chosen menu item.
card.setObjectEnabled (objectName, enabled?)
Enables or disables the object named objectName in the current card, depending on the boolean enabled?.
card.setObjectFlag (objectName, boolean)
Sets the boolean status of the object named objectName in the current card to boolean. The boolean status of a radio button or check box is true if it is highlighted or checked, false if not. The boolean status of an ordinary button is whether it is the default button or not.
card.setObjectText (objectName, string)
Sets the text of the object named objectName in the current card to string. The text of a button is its title. The text of a text field, whether user-editable or not, is the text in the field.
card.setObjectVisible (objectName, visible?)
Shows or hides the object named objectName in the current card, depending on the boolean visible?.
clipboard.get (MacOSFormat, addrObject)
Copies the MacOSFormat component of the system scrap's contents into the object at addrObject as a binary whose internal data type is MacOSFormat, which will typically be 'TEXT' or 'PICT'.
clipboard.getValue (MacOSFormat)
Returns the MacOSFormat component of the system scrap's contents, unpacked so as to be of type MacOSFormat, which will typically be 'TEXT' or 'PICT'.
clipboard.put (MacOSFormat, addrObject)
Copies the value of the object at addrObject onto the system scrap in the format MacOSFormat, which will typically be 'TEXT' or 'PICT'.
clipboard.putValue (value)
Calls clipboard.put() to copy value onto the system scrap, supplying MacOSFormat from the datatype (or, if a binary, the internal datatype) of value.
clock.sleepFor (seconds)
Within an agent script (or a script called by an agent script), tells Frontier to call the agent script again seconds seconds after the agent script finishes executing. An agent script that never calls this verb will be called again one second after it finishes executing. Within a modeless dialog proc, puts the dialog to sleep temporarily. It is a runtime error to use this verb outside either the agent thread or a modeless dialog proc.
clock.ticks ()
Returns the number of ticks (approximately sixtieths of a second) that have elapsed since the computer was started up.
clock.waitSixtieths (n)
Pauses for n sixtieths of a second. n is coerced to an integer.
date.abbrevString (date)
Returns the system's abbrevDate string representation of date.
date.dayOfWeek (date)
Returns the day-of-week number for date, where 1 represents Sunday.
date.daysInMonth (date)
Returns the number of days in the month in which date falls.
date.dayString (number)
Returns the name of the day denoted by the day-of-week number number, or the empty string if number is not an integer from 1 to 7.
date.firstOfMonth (date)
Returns the date value for 12:00 midnight on the first day of the month in which date falls.
date.get (theDate, addrDay, addrMonth, addrYear,
addrHour, addrMin, addrSec)
Analyzes theDate into numerical values (shorts) and stores them at the addresses provided in the other parameters.
date.lastOfMonth (date)
Returns the date value for 12:00 midnight on the last day of the month in which date falls.
date.nextMonth (date)
Returns the date resulting from adding 1 to date 's month component.
date.nextWeek (date)
Returns the date resulting from adding 7 to date 's day component.
date.nextYear (date)
Returns the date resulting from adding 1 to date 's year component.
date.prevMonth (date)
Returns the date resulting from subtracting 1 from date 's month component.
date.prevWeek (date)
Returns the date resulting from subtracting 7 from date 's day component.
date.prevYear (date)
Returns the date resulting from subtracting 1 from date 's year component.
date.set (day, month, year, hour, min, sec)
Returns a date constructed from the numeric parameters; they are coerced to integers before use.
date.shortString (date)
Returns the system's shortDate string representation of date.
date.tomorrow (date)
Returns the date resulting from adding 1 to date 's day component.
date.yesterday (date)
Returns the date resulting from subtracting 1 from date 's day component.
db.close (pathname)
Closes, without saving, the database at pathname, which must have been opened with db.open().
db.countItems (pathname, entryPathString)
Returns the number of entries in the table object entryPathString in the database at pathname, which must have been opened with db.open(). If the object does not exist or is not a table, an error will be raised.
db.defined (pathname, entryPathString)
Returns a boolean reporting whether an object entryPathString exists in the database at pathname, which must have been opened with db.open().
db.delete (pathname, entryPathString)
Destroys the object entryPathString in the database at pathname, which must have been opened with db.open(). If the object does not exist, an error will be raised.
db.get (entryPathString)
Called from an AppleScript script, returns the value of the database object named by entryPathString.
db.getNthItem (pathname, entryPathString, n)
Returns the value of the n th entry in the table object entryPathString in the database at pathname, which must have been opened with db.open(). If the object does not exist or is not a table, an error will be raised.
db.getValue (pathname, entryPathString)
Returns the value of the object entryPathString in the database at pathname, which must have been opened with db.open(). If the object does not exist, an error will be raised.
db.isTable (pathname, entryPathString)
Returns a boolean reporting whether the object entryPathString in the database at pathname, which must have been opened with db.open(), is a table. If the object does not exist, an error will be raised.
db.new (pathname)
Creates a new minimal database on disk, at pathname. If there is already a file or empty folder at pathname, it is deleted first. The new database is not opened.
db.newTable (pathname, tablePathString)
Creates at tablePathString a new table in the database at pathname, which must have been opened with db.open(). If an object already exists at this location, it will be deleted first. If the proposed table's parent does not exist, an error will be raised.
db.open (pathname, readOnly?)
Opens the existing database at pathname, ready to work with it programmatically through the other db verbs. The boolean readOnly? is not optional.
db.save (pathname)
Saves the database at pathname, which must have been opened with db.open(), returning a boolean reporting whether it did in fact save the database.
db.set (entryPathString, value)
Called from an AppleScript script, sets to value the database object named by entryPathString.
db.setValue (pathname, entryPathString, value)
Sets to value the value of the object entryPathString in the database at pathname, which must have been opened with db.open(). The object will be created if necessary. If an object already exists at this location, it will be deleted first. If the proposed table's parent does not exist, an error will be raised.
dialog.alert (text)
Displays a modal dialog containing an "attention" icon, text coerced to a string, and an OK button; and sounds the system beep.
dialog.ask (text, addrResult)
Displays a modal dialog containing text coerced to a string, a Cancel button and an OK button, which is the default. The dialog also contains an editable text field, which initially contains the value at addrResult coerced to a string. Returns false if the user clicks Cancel, true otherwise; if true, the contents of the editable text field are stored at addrResult.
dialog.confirm (text)
Displays a modal dialog containing text coerced to a string, a Cancel button and an OK button, which is the default. Returns false if the user clicks Cancel, true otherwise.
dialog.fileInfo (pathname)
Displays a modal file information dialog about the file at pathname ; if no such file exists, an error is raised.
dialog.getInt (text, addrResult)
Displays a modal dialog containing text coerced to a string, a Cancel button and an OK button, which is the default. The dialog also contains an editable text field, which initially contains the value at addrResult coerced to a string. Returns false if the user clicks Cancel, true otherwise; if true, the contents of the editable text field are coerced to a short (raising an error if this is impossible) and stored at addrResult.
dialog.getValue (itemNum)
Used in the proc of a resource-based dialog (it is a runtime error to use it in any other context), returns the value of the item of the dialog whose item number is itemNum. The value of a checkbox or radio button is a boolean. The value of a text item is the text, as a string. The value of a button is its title, as a string. Certain miscellaneous controls, such as a scrollbar, have a value which is a short.
dialog.hideItem (itemNum)
Used in the proc of a resource-based dialog (it is a runtime error to use it in any other context), makes invisible the item of the dialog whose item number is itemNum.
dialog.loadFromFile (pathname)
Loads from the file at pathname into the resource fork of the database the first 'DLOG' and 'DITL' whose ID is greater than or equal to 25000, plus all other resources whose ID is greater than or equal to 25000. Returns the ID of the 'DLOG'.
dialog.notify (text)
Displays a modal dialog containing a "chat" icon, text coerced to a string, and an OK button.
dialog.run (resourceID, defaultItemNum, addrProc)
Displays a resource-based modal dialog. resourceID is the ID of a 'DLOG' resource already in the resource chain. defaultItemNum specifies the item number of the default item in the dialog (to be "hit" automatically when the user hits Enter or Return); typically, this is 1. addrProc specifies the address of the handler to be called as the proc for the dialog.
dialog.runFromFile (pathname, defaultItemNum, addrProc)
Displays a modal dialog whose resources are file-based, by calling dialog.loadFromFile() and dialog.run().
dialog.runModeless (resourceID, defaultItemNum, addrProc)
Displays a resource-based modal dialog. resourceID is the ID of a 'DLOG' resource already in the resource chain. defaultItemNum specifies the item number of the default item in the dialog (to be "hit" automatically when the user hits Enter or Return); typically, this is 1. addrProc specifies the address of the handler to be called as the proc for the dialog.
dialog.setItemEnable (itemNum, enabled?)
Used in the proc of a resource-based dialog (it is a runtime error to use it in any other context), makes enabled or disabled the item of the dialog whose item number is itemNum, depending on whether enabled? is true or false.
dialog.setValue (itemNum, newValue)
Used in the proc of a resource-based dialog (it is a runtime error to use it in any other context), sets to newValue the value of the item of the dialog whose item number is itemNum. The value of a checkbox or radio button is a boolean. The value of a text item is the text, as a string. The value of a button is its title, as a string. Certain miscellaneous controls, such as a scrollbar, have a value that is a short.
dialog.showItem (itemNum)
Used in the proc of a resource-based dialog (it is a runtime error to use it in any other context), makes visible the item of the dialog whose item number is itemNum.
dialog.threeWay (text, yesButton, noButton, cancelButton)
Displays a modal dialog containing text coerced to a string, a button that says cancelButton, a button that says noButton, and a button that says yesButton, which is the default. Returns 3, 2, or 1 respectively, depending on which button the user clicks.
dialog.twoWay (text, OKbutton, cancelButton)
Displays a modal dialog containing text coerced to a string, a button that says cancelButton, and a button that says OKbutton, which is the default. Returns false if the user clicks the cancelButton, true otherwise.
dialog.yesNo (text)
Displays a modal dialog containing text coerced to a string, a No button and a Yes button, which is the default. Returns false if the user clicks No, true otherwise.
dialog.yesNoCancel (text)
Displays a modal dialog containing text coerced to a string, a Cancel button, a No button, and a Yes button, which is the default. Returns 3, 2, or 1 respectively, depending on which button the user clicks.
editMenu.clear ()
Like choosing Clear from the Edit menu. Operates on the current target.
editMenu.copy ()
Like choosing Copy from the Edit menu. Operates on the current target.
editMenu.paste ()
Like choosing Paste from the Edit menu. Operates on the current target.
editMenu.plainText ()
Removes all text styling from the current selection in the wptext target window.
editMenu.selectAll ()
Like choosing Select All from the Edit menu. Operates on the current target; if a wptext or in content mode, selects the whole wptext "document," otherwise selects all lines of the outline at the same level as the current selection. In a table edit window, switches to content mode.
editMenu.setBold (boolean)
Turns bold text styling on or off, depending on boolean, for the current selection in the wptext target window.
editMenu.setFont (nameString)
Like choosing the font called nameString from the Font submenu of the Edit menu. Operates on the current target.
editMenu.setFontSize (sizeInteger)
Like choosing the font size sizeInteger from the Size submenu of the Edit menu. Operates on the current target.
editMenu.setItalic (boolean)
Turns italic text styling on or off, depending on boolean, for the current selection in the wptext target window.
editMenu.setOutline (boolean)
Turns outline text styling on or off, depending on boolean, for the current selection in the wptext target window.
editMenu.setShadow (boolean)
Turns shadow text styling on or off, depending on boolean, for the current selection in the wptext target window.
editMenu.setUnderline (boolean)
Turns underline text styling on or off, depending on boolean, for the current selection in the wptext target window.
file.bytesInFolder (folderPathname)
Returns the total number of bytes occupied by all files in the folder at folderPathname.
file.bytesOnVolume (volumePathname)
Returns the number of occupied bytes in the volume at volumePathname.
file.close (pathname)
Closes the file at pathname, ending a read/write access session. Returns false if the file is not open; raises an error if the file does not exist.
file.compare (pathname1, pathname2)
Returns a boolean reporting whether the dataforks of the files at pathname1 and pathname2 are identical.
file.copy (source, dest)
Copies the file or folder at source to a new location, maintaining creation and modification dates for copied material. If source is a folder, its contents, not the folder itself, are copied into dest, which must be a folder. If dest is a folder, what is being copied is copied into it; the whole dest pathname must denote existing folders, except that if source is a folder, the last element of dest will be created if it doesn't exist. If dest is a file, then source must be a file. Copied files replace existing files with the same name.
file.copyDataFork (source, dest)
Creates a new file at dest (replacing an existing file) that is identical to the file at source without its resource fork.
file.copyResourceFork (source, dest)
Creates a new file at dest (replacing an existing file) that is identical to the file at source without its data fork.
file.copyToSystemFolder (source)
A utility script which simulates dropping the file or folder source onto the system folder's icon, copying it into its proper subfolder if it is a file of special type, and otherwise copying it into the system folder itself.
file.countLines (pathname)
Returns the number of end-of-lines (cr) in the file at pathname, which should not be opened beforehand. (If the file is opened beforehand, returns 0 if any reading has been done this session.)
file.delete (pathname)
Deletes the file or empty folder at pathname. An error is raised if the item at pathname is a folder with contents, or is locked or "busy" (open for use by some application).
file.eject (volumePathname)
Tries to eject the volume at volumePathname. This is not the same as unmounting the volume. Returns false if the volume is not ejectable.
file.endOfFile (pathname)
Returns false if on the next command it would be possible to read at least one character from the file at pathname using file.read(); true is returned if the file is not open or does not exist.
file.exists (pathname)
Returns a boolean reporting whether the file, folder or volume at pathname exists.
file.filesInFolder (folderPathname, depth)
Returns the total number of files and folders in the folder at folderPathname, to depth depth.
file.filesOnVolume (volumePathname)
Returns the number of files and folders, including invisible files and folders, in the volume at volumePathname.
file.filteredCopy (source, dest, addrProc)
Selectively copies the file or folder at source to a new location. A utility script. The basic mechanics are identical to file.copy(); in fact, file.copy() is simply a script that calls file.filteredCopy() with a proc that always returns true. The proc, a handler pointed to by addrProc, must take a single parameter, a pathname, and return true or false as that file should or should not be copied. If the proc says a folder isn't to be copied, its contents are never tested.
file.findApplication (string4)
Returns the pathname of the application associated with the string4 creator code string4. The volumes are searched beginning with the startup volume. The search ends when a volume containing the application is found. If that volume contains more than one instance of the application, the pathname of the more recent instance of the application is returned.
file.findInFile (pathname, whatToLookFor)
whatToLookFor is coerced to a string, and if it appears in the file at pathname (which need not be opened beforehand), true is returned, false otherwise. If pathname doesn't exist, an error is raised.
file.findInFolder (folderPathname, depth, whatToLookFor)
whatToLookFor is coerced to a string, and if it appears in some file in the folder at folderPathname, searching to depth depth, returns the pathname of the first such file encountered; otherwise, returns the empty string.
file.folderFromPath (pathname)
Returns all but the last element of the pathname string pathname.
file.foldersInFolder (folderPathname, depth)
Returns the total number of folders in the folder at folderPathname, to depth depth.
file.foldersOnVolume (volumePathname)
Returns the number of folders, including invisible folders, in the volume at volumePathname.
file.followAlias (pathname)
Returns the pathname of the original of the alias file at pathname. If what's at pathname is not an alias, returns the empty string. If there is nothing at pathname, a very weird error is raised.
file.freespaceOnVolume (volumePathname)
Returns the number of free bytes in the volume at volumePathname.
file.getComment (pathname)
Returns the comment string of the file or folder at pathname.
file.getDiskDialog (text, addrResult)
Displays a modal dialog permitting the user to choose a volume, including prompt text ("" for no prompt), a Cancel button, and an Open button. The volume initially displayed may be set by supplying a pathname at addrResult. Returns false if the user clicks Cancel, true otherwise. If true, the pathname of the chosen volume is stored at addrResult.
file.getFileDialog (text, addrResult, fileTypes)
Displays the Mac OS StandardGetFile modal dialog, permitting the user to choose a file, including prompt text ("" for no prompt), a Cancel button, and an Open button. fileTypes specifies what types of file are listed; it may be a string4 type designator or a list of such type designators, or 0 to show all files. The directory (and file) initially displayed may be set by supplying a pathname at addrResult. Returns false if the user clicks Cancel, true otherwise. If true, the pathname of the chosen file is stored at addrResult.
file.getFolderDialog (text, addrResult)
Displays a modified Mac OS StandardGetFile modal dialog, permitting the user to choose a folder, including prompt text ("" for no prompt), a Cancel button, an Open button, and a button to choose the presently selected folder. The directory initially displayed may be set by supplying a pathname at addrResult. Returns false if the user clicks Cancel, true otherwise. If true, the pathname of the chosen folder is stored at addrResult.
file.getIconPos (pathname, addrHoriz, addrVert)
Stores at addrHoriz and addrVert the components of the icon position of the file or folder at pathname.
file.getPath ()
Returns the current pathname prefix, which is automatically prefixed to a one-element file pathname string when it is resolved as a fileSpec.
file.getSpecialFolderPath (volumePathname, folder, create?)
Returns the pathname of any system folder's standard subfolders. Values for folder are: "Apple", "Control", "Desktop", "Extensions", "Fonts", "Preferences", "PrintMonitor", "Startup", "System", "Temp", "Trash". The folder is sought on the volume designated by volumePathname. If there is no system folder on that volume, an error is raised. If the requested folder doesn't exist, it is created if create? is true, otherwise an error is raised.
file.isAlias (pathname)
Returns a boolean reporting whether the file at pathname is an alias. If no such file exists, an error is raised.
file.isBusy (pathname)
Returns a boolean reporting whether the file at pathname is "busy" (open for use by an application).
file.isEjectable (volumePathname)
Returns a boolean reporting whether the volume at volumePathname is ejectable, like a floppy disk or a CD.
file.isFolder (pathname)
Returns a boolean reporting whether the file at pathname is a folder (or volume). If no such file exists, an error is raised.
file.isLocked (pathname)
Returns a boolean reporting whether the file or folder at pathname is locked.
file.isVisible (pathname)
Returns a boolean reporting whether the file or folder at pathname is visible.
file.isVolume (pathname)
Returns a boolean reporting whether pathname designates a volume. If no such item exists, an error is raised.
file.modified (pathname)
Returns the modification date of the file or folder at pathname.
file.mountServerVolume (path, userID, password)
Attempts to mount the remote volume path, which is of the form " zone: machineID: volName"; to signify the local zone, "*" may be used for the zone. Returns true if the volume was successfully mounted; if the server was not found, or an invalid userID and password were provided, an error is raised. For guest login, supply the empty string ("") as the userID and password.
file.move (source, destFolder)
Moves the file or folder at source into destFolder, which must be an existing folder on the same volume as source, and must not contain a file or folder with the same name as source.
file.new (pathname)
Creates a new file at pathname ; if there is already a file or empty folder at pathname it is deleted first. The new file has type and creator codes '????', and no data. All elements of pathname except the last must exist.
file.newAlias (original, dest)
Creates at dest an alias of the file, folder or volume at original. Everything but the last element of dest must exist. If there is already a file or folder at dest, an error is raised.
file.newFolder (pathname)
Creates at pathname a new empty folder. Everything but the last element of pathname must exist. If there is already a file or folder at pathname, an error is raised.
file.open (pathname)
Opens the file at pathname for read/write access, beginning a session. An error is raised if the file couldn't be opened.
file.putFileDialog (text, addrResult)
Displays the Mac OS StandardPutFile modal dialog, permitting the user to specify a folder and supply a filename, including prompt text ("" for "Save as:"), an editable text field, a New Folder button, a Cancel button, and a Save button. Any folders the user creates with the New Folder button are actually created. The directory initially displayed and the initial contents of the editable text field may be set by supplying a pathname at addrResult. Returns false if the user clicks Cancel, true otherwise. If the designated file already exists, a secondary name-conflict dialog appears, and true is not returned unless Replace is clicked. If true, the pathname of the specified file is stored at addrResult ; it will not be an existing folder or an illegal pathname.
file.read (pathname, howManyCharacters)
Reads characters from the file at pathname ; returns a binary consisting of the characters read, or false if the file is not open. The read starts after the end of the previous read during the present session, or at the beginning of the file if there was no previous read. If howManyCharacters is too large, then if howManyCharacters is infinity the file is read to the end, but otherwise the read fails, false is returned, and further reading in this session becomes impossible (because the pointer is now at end-of-file).
file.readLine (pathname)
Reads characters from the file at pathname ; returns a string (not a binary!) consisting of the characters read, or the empty string if the file is not open. The read starts after the end of the previous read during the present session, or at the beginning of the file if there was no previous read. The read continues until end-of-line is encountered (cr); the position pointer is moved past the end-of-line, but the end-of-line is not included in the returned string. If end-of-file is encountered, text is read successfully; but if the read starts at end-of-file, the empty string is returned.
file.rename (pathname, nameString)
Renames the file or folder or volume at pathname, giving it the name nameString, which should be just the new name, not a pathname.
file.setComment (pathname, commentString)
Sets to commentString the comment string of the file or folder at pathname.
file.setCreated (pathname, date)
Sets to date the creation date of the file or folder at pathname.
file.setCreator (pathname, string4)
Sets to string4 the string4 creator code of the file at pathname.
file.setFullVersion (pathname, versionString)
Sets to versionString the full version string of the file at pathname.
file.setIconPos (pathname, horiz, vert)
Sets to horiz and vert the components of the icon position of the file or folder at pathname.
file.setLabel (pathname, labelString)
Sets to labelString the label of the file or folder at pathname. labelString must match one of the labels registered in the Labels control panel, or nothing will happen.
file.setModified (pathname, date)
Sets to date the modification date of the file or folder at pathname.
file.setPath (pathString)
Sets the current pathname prefix to pathString, which must be the full pathname of an existing volume or folder. The change remains in force until Frontier is quit. The pathname prefix is automatically prefixed to a one-element file pathname string when it is resolved as a fileSpec.
file.setType (pathname, string4)
Sets to string4 the string4 type code of the file at pathname.
file.setVersion (pathname, versionString)
Sets to versionString the version string of the file at pathname.
file.setVisible (pathname, visible?)
Sets the visibility of the file or folder at pathname according to the boolean visible?.
file.size (pathname)
Returns the logical size of the file at pathname, the total bytes of the file's resource fork and data fork combined.
file.sureFolder (pathname)
Creates at pathname a new empty folder. Everything but the last element of pathname must exist. If there is already a file or folder at pathname, nothing happens.
file.unmountVolume (volumePathname)
Tries to unmount the volume at volumePathname. The volume may be an ejectable medium or a remote volume. Stronger than file.eject(), which ejects the physical medium but retains the volume information. If the volume cannot be unmounted (because it contains files in use, for example), an error is raised.
file.visitFolder (folderPathString, depth, addrProc)
The script or handler pointed to by addrProc must take one parameter, which will be a reference to each file or folder in the folder denoted by folderPathString, recursing to the depth indicated by the integer depth; it must return a boolean saying whether it wants to be called again. File and folders in a folder are passed before that folder.
file.volumeBlockSize (volumePathname)
Returns the block size, in bytes, of the volume at volumePathname.
file.volumeSize (volumePathname)
Returns the total number of bytes in the volume at volumePathname.
file.write (pathname, whatToWrite)
Coerces whatToWrite to a binary and appends it to the file at pathname. The file is implicitly opened and closed, but it is well to call file.open() and file.close() anyway. Raises an error if the file does not exist or is a folder; but certain conditions (for example, the file is busy) will return false without raising an error, so it may be wise to check the result as well.
file.writeLine (pathname, whatToWrite)
Same as file.write() except that whatToWrite is first coerced to a string and cr is appended to it.
filemenu.closeAll ()
Closes all open windows, not including the Main Window, unless the Main Window is frontmost.
filemenu.new (pathname)
Creates a new minimal database at pathname, and opens it as a second database. If there is already a file or empty folder at pathname, it is deleted first.
filemenu.open (pathname)
Opens the file at pathname. The effect is as if the file's icon had been dropped onto Frontier's icon; if the file is of a type that belongs to Frontier, it is also the same as if the file had been opened from the Finder. So, a packed object will be imported, a desktop script will be run, a second database will be opened, a HyperCard stack will have its XCMDs imported, and so on.