This page uses CSS, and renders properly in the latest versions of Microsoft Internet Explorer and Mozilla.
This is Frontier: The Definitive Guide by Matt Neuburg, unabridged and unaltered from the January 1998 printing.
It deals with the freeware Frontier 4.2.3; for commercial Frontier 8, look here, and for the inexpensive Radio UserLand, look here. See my Web site for information.
Those wishing an offline or printed copy may purchase the book, which is still in print.
Copyright 1998 O'Reilly & Associates, Inc. ALL RIGHTS RESERVED. Reprinted with permission.
TOP UP: Reference NEXT: Apple Event Suites

46

Verbs

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.

alt
abs

abs (number)

Returns the absolute value of number.

alt
appleEvent

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.

alt
callXCMD

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.

alt
close

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.

alt
complexEvent

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.

alt
defined

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.

alt
delete

delete (addrObject)

If addrObject is an array specifier, removes the specified item from the array. Otherwise, destroys the object at addrObject.

alt
displayString

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.

alt
edit

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.

alt
evaluate

evaluate (string)

Evaluates string as a UserTalk expression and returns the result.

alt
finderEvent

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.

alt
gestalt

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.

alt
getBinaryType

getBinaryType (binary)

Returns the string4 which is the internal datatype of binary.

alt
memAvail

memAvail ()

Returns the amount of free RAM memory in Frontier's heap, in bytes.

alt
mod

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.

alt
msg

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.

alt
nameOf

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.

alt
new

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.

alt
pack

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.

alt
parentOf

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.

alt
random

random (integer1, integer2)

Returns a pseudo-random integer between integer1 and integer2 inclusive.

alt
rollBeachball

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.

alt
scriptError

scriptError (string)

Throws an error whose error message is string.

alt
setBinaryType

getBinaryType (addrBinary, string4)

Sets the internal datatype of the binary at addrBinary to string4.

alt
setEventInteraction

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.

alt
setEventTimeout

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.

alt
setEventTransactionID

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.

alt
sizeOf

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.

alt
syscrash

syscrash ([string])

Falls into the system-level debugger, optionally displaying string.

alt
systemEvent

systemEvent (type,subtype,name1,value1,...)
systemEvent (type,subtype,table,...)
systemEvent (type,subtype,record,...)

Identical to calling appleEvent() with an appID of 0.

alt
tableEvent

tableEvent (addrTable,addr,appID,type,subtype,

name1,value1,...)

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.

alt
timeCreated

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.

alt
timeModified

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.

alt
transactionEvent

transactionEvent (appID,type,subtype,transID,

name1,value1,...)

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().

alt
typeOf

typeOf (value)

Returns the string4 designator of the datatype of value.

alt
unpack

unpack (addrSource, addrDest)

Coerces the binary value at addrSource into that binary's internal type, and stores the result in the object at addrDest.

alt
app.clearNetworkApp

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.

alt
app.linkToNetworkApp

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.

alt
app.start

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.

alt
app.startWithDocument

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.

alt
bit.clear

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.

alt
bit.get

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.

alt
bit.set

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.

alt
card.close

card.close ()

Closes the current card.

alt
card.getObjectEnabled

card.getObjectEnabled (objectName)

Returns a boolean saying whether the object named objectName in the current card is enabled.

alt
card.getObjectFlag

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.

alt
card.getObjectText

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.

alt
card.getObjectVisible

card.getObjectVisible (objectName)

Returns a boolean saying whether the object named objectName in the current card is visible.

alt
card.isModal

card.isModal ()

Returns a boolean saying whether the current card is modal.

alt
card.popup.getCheckedItem

card.popup.getCheckedItem (objectName)

Returns the number of the currently chosen menu item of the popup menu named objectName in the current card.

alt
card.popup.getHasLabel

card.popup.getHasLabel (objectName)

Returns a boolean saying whether the label of the popup menu named objectName in the current card is visible.

alt
card.popup.getMenu

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.

alt
card.popup.getSelectedText

card.popup.getSelectedText (objectName)

Returns the name of the currently chosen menu item of the popup menu named objectName in the current card.

alt
card.popup.setCheckedItem

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.

alt
card.popup.setHasLabel

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?.

alt
card.popup.setMenu

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.

alt
card.popup.setSelectedText

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.

alt
card.run

card.run (addrCardObject)

Displays as a dialog the card object at addrCardObject.

alt
card.setObjectEnabled

card.setObjectEnabled (objectName, enabled?)

Enables or disables the object named objectName in the current card, depending on the boolean enabled?.

alt
card.setObjectFlag

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.

alt
card.setObjectText

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.

alt
card.setObjectVisible

card.setObjectVisible (objectName, visible?)

Shows or hides the object named objectName in the current card, depending on the boolean visible?.

alt
clipboard.get

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'.

alt
clipboard.getValue

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'.

alt
clipboard.put

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'.

alt
clipboard.putValue

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.

alt
clock.now

clock.now ()

Returns the date from the system clock.

alt
clock.set

clock.set (dateTime)

Sets the system clock to dateTime.

alt
clock.sleepFor

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.

alt
clock.ticks

clock.ticks ()

Returns the number of ticks (approximately sixtieths of a second) that have elapsed since the computer was started up.

alt
clock.waitSeconds

clock.waitSeconds (n)

Pauses for n seconds. n is coerced to an integer.

alt
clock.waitSixtieths

clock.waitSixtieths (n)

Pauses for n sixtieths of a second. n is coerced to an integer.

alt
date.abbrevString

date.abbrevString (date)

Returns the system's abbrevDate string representation of date.

alt
date.dayOfWeek

date.dayOfWeek (date)

Returns the day-of-week number for date, where 1 represents Sunday.

alt
date.daysInMonth

date.daysInMonth (date)

Returns the number of days in the month in which date falls.

alt
date.dayString

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.

alt
date.firstOfMonth

date.firstOfMonth (date)

Returns the date value for 12:00 midnight on the first day of the month in which date falls.

alt
date.get

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.

alt
date.lastOfMonth

date.lastOfMonth (date)

Returns the date value for 12:00 midnight on the last day of the month in which date falls.

alt
date.longString

date.longString (date)

Returns the system's longDate string representation of date.

alt
date.nextMonth

date.nextMonth (date)

Returns the date resulting from adding 1 to date 's month component.

alt
date.nextWeek

date.nextWeek (date)

Returns the date resulting from adding 7 to date 's day component.

alt
date.nextYear

date.nextYear (date)

Returns the date resulting from adding 1 to date 's year component.

alt
date.prevMonth

date.prevMonth (date)

Returns the date resulting from subtracting 1 from date 's month component.

alt
date.prevWeek

date.prevWeek (date)

Returns the date resulting from subtracting 7 from date 's day component.

alt
date.prevYear

date.prevYear (date)

Returns the date resulting from subtracting 1 from date 's year component.

alt
date.set

date.set (day, month, year, hour, min, sec)

Returns a date constructed from the numeric parameters; they are coerced to integers before use.

alt
date.shortString

date.shortString (date)

Returns the system's shortDate string representation of date.

alt
date.tomorrow

date.tomorrow (date)

Returns the date resulting from adding 1 to date 's day component.

alt
date.weeksInMonth

date.weeksInMonth (date)

Returns date.daysInMonth( date) integer-divided by 7.

alt
date.yesterday

date.yesterday (date)

Returns the date resulting from subtracting 1 from date 's day component.

alt
db.close

db.close (pathname)

Closes, without saving, the database at pathname, which must have been opened with db.open().

alt
db.countItems

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.

alt
db.defined

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().

alt
db.delete

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.

alt
db.get

db.get (entryPathString)

Called from an AppleScript script, returns the value of the database object named by entryPathString.

alt
db.getNthItem

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.

alt
db.getValue

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.

alt
db.isTable

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.

alt
db.new

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.

alt
db.newTable

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.

alt
db.open

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.

alt
db.save

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.

alt
db.set

db.set (entryPathString, value)

Called from an AppleScript script, sets to value the database object named by entryPathString.

alt
db.setValue

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.

alt
dialog.alert

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.

alt
dialog.ask

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.

alt
dialog.confirm

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.

alt
dialog.fileInfo

dialog.fileInfo (pathname)

Displays a modal file information dialog about the file at pathname ; if no such file exists, an error is raised.

alt
dialog.getInt

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.

alt
dialog.getValue

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.

alt
dialog.hideItem

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.

alt
dialog.loadFromFile

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'.

alt
dialog.notify

dialog.notify (text)

Displays a modal dialog containing a "chat" icon, text coerced to a string, and an OK button.

alt
dialog.run

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.

alt
dialog.runFromFile

dialog.runFromFile (pathname, defaultItemNum, addrProc)

Displays a modal dialog whose resources are file-based, by calling dialog.loadFromFile() and dialog.run().

alt
dialog.runModeless

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.

alt
dialog.setItemEnable

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.

alt
dialog.setValue

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.

alt
dialog.showItem

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.

alt
dialog.threeWay

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.

alt
dialog.twoWay

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.

alt
dialog.yesNo

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.

alt
dialog.yesNoCancel

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.

alt
editMenu.clear

editMenu.clear ()

Like choosing Clear from the Edit menu. Operates on the current target.

alt
editMenu.copy

editMenu.copy ()

Like choosing Copy from the Edit menu. Operates on the current target.

alt
editMenu.cut

editMenu.cut ()

Like choosing Cut from the Edit menu. Operates on the current target.

alt
editMenu.paste

editMenu.paste ()

Like choosing Paste from the Edit menu. Operates on the current target.

alt
editMenu.plainText

editMenu.plainText ()

Removes all text styling from the current selection in the wptext target window.

alt
editMenu.selectAll

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.

alt
editMenu.setBold

editMenu.setBold (boolean)

Turns bold text styling on or off, depending on boolean, for the current selection in the wptext target window.

alt
editMenu.setFont

editMenu.setFont (nameString)

Like choosing the font called nameString from the Font submenu of the Edit menu. Operates on the current target.

alt
editMenu.setFontSize

editMenu.setFontSize (sizeInteger)

Like choosing the font size sizeInteger from the Size submenu of the Edit menu. Operates on the current target.

alt
editMenu.setItalic

editMenu.setItalic (boolean)

Turns italic text styling on or off, depending on boolean, for the current selection in the wptext target window.

alt
editMenu.setOutline

editMenu.setOutline (boolean)

Turns outline text styling on or off, depending on boolean, for the current selection in the wptext target window.

alt
editMenu.setShadow

editMenu.setShadow (boolean)

Turns shadow text styling on or off, depending on boolean, for the current selection in the wptext target window.

alt
editMenu.setUnderline

editMenu.setUnderline (boolean)

Turns underline text styling on or off, depending on boolean, for the current selection in the wptext target window.

alt
file.bytesInFolder

file.bytesInFolder (folderPathname)

Returns the total number of bytes occupied by all files in the folder at folderPathname.

alt
file.bytesOnVolume

file.bytesOnVolume (volumePathname)

Returns the number of occupied bytes in the volume at volumePathname.

alt
file.close

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.

alt
file.compare

file.compare (pathname1, pathname2)

Returns a boolean reporting whether the dataforks of the files at pathname1 and pathname2 are identical.

alt
file.copy

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.

alt
file.copyDataFork

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.

alt
file.copyResourceFork

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.

alt
file.copyToSystemFolder

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.

alt
file.countLines

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.)

alt
file.countVolumes

file.countVolumes ()

Returns the number of volumes currently mounted.

alt
file.created

file.created (pathname)

Returns the creation date of the file or folder at pathname.

alt
file.creator

file.creator (pathname)

Returns the string4 creator code of the file at pathname.

alt
file.delete

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).

alt
file.deleteFolder

file.deleteFolder (pathname)

Deletes the folder at pathname even if it has contents.

alt
file.eject

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.

alt
file.endOfFile

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.

alt
file.exists

file.exists (pathname)

Returns a boolean reporting whether the file, folder or volume at pathname exists.

alt
file.fileFromPath

file.fileFromPath (pathname)

Returns the last element of the pathname string pathname.

alt
file.filesInFolder

file.filesInFolder (folderPathname, depth)

Returns the total number of files and folders in the folder at folderPathname, to depth depth.

alt
file.filesOnVolume

file.filesOnVolume (volumePathname)

Returns the number of files and folders, including invisible files and folders, in the volume at volumePathname.

alt
file.filteredCopy

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.

alt
file.findApplication

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.

alt
file.findInFile

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.

alt
file.findInFolder

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.

alt
file.folderFromPath

file.folderFromPath (pathname)

Returns all but the last element of the pathname string pathname.

alt
file.foldersInFolder

file.foldersInFolder (folderPathname, depth)

Returns the total number of folders in the folder at folderPathname, to depth depth.

alt
file.foldersOnVolume

file.foldersOnVolume (volumePathname)

Returns the number of folders, including invisible folders, in the volume at volumePathname.

alt
file.followAlias

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.

alt
file.freespaceOnVolume

file.freespaceOnVolume (volumePathname)

Returns the number of free bytes in the volume at volumePathname.

alt
file.getComment

file.getComment (pathname)

Returns the comment string of the file or folder at pathname.

alt
file.getDiskDialog

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.

alt
file.getFileDialog

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.

alt
file.getFolderDialog

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.

alt
file.getFullVersion

file.getFullVersion (pathname)

Returns the full version string of the file at pathname.

alt
file.getIconPos

file.getIconPos (pathname, addrHoriz, addrVert)

Stores at addrHoriz and addrVert the components of the icon position of the file or folder at pathname.

alt
file.getLabel

file.getLabel (pathname)

Returns the label of the file or folder at pathname.

alt
file.getPath

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.

alt
file.getSpecialFolderPath

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.

alt
file.getSystemDisk

file.getSystemDisk ()

Returns the pathname of the startup volume.

alt
file.getSystemFolderPath

file.getSystemFolderPath ()

Returns the pathname of the active system folder.

alt
file.getVersion

file.getVersion (pathname)

Returns the version string of the file at pathname.

alt
file.isAlias

file.isAlias (pathname)

Returns a boolean reporting whether the file at pathname is an alias. If no such file exists, an error is raised.

alt
file.isBusy

file.isBusy (pathname)

Returns a boolean reporting whether the file at pathname is "busy" (open for use by an application).

alt
file.isEjectable

file.isEjectable (volumePathname)

Returns a boolean reporting whether the volume at volumePathname is ejectable, like a floppy disk or a CD.

alt
file.isFolder

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.

alt
file.isLocked

file.isLocked (pathname)

Returns a boolean reporting whether the file or folder at pathname is locked.

alt
file.isVisible

file.isVisible (pathname)

Returns a boolean reporting whether the file or folder at pathname is visible.

alt
file.isVolume

file.isVolume (pathname)

Returns a boolean reporting whether pathname designates a volume. If no such item exists, an error is raised.

alt
file.lock

file.lock (pathname)

Locks the file or folder at pathname.

alt
file.modified

file.modified (pathname)

Returns the modification date of the file or folder at pathname.

alt
file.mountServerVolume

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.

alt
file.move

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.

alt
file.new

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.

alt
file.newAlias

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.

alt
file.newFolder

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.

alt
file.open

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.

alt
file.putFileDialog

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.

alt
file.read

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).

alt
file.readLine

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.

alt
file.rename

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.

alt
file.setComment

file.setComment (pathname, commentString)

Sets to commentString the comment string of the file or folder at pathname.

alt
file.setCreated

file.setCreated (pathname, date)

Sets to date the creation date of the file or folder at pathname.

alt
file.setCreator

file.setCreator (pathname, string4)

Sets to string4 the string4 creator code of the file at pathname.

alt
file.setFullVersion

file.setFullVersion (pathname, versionString)

Sets to versionString the full version string of the file at pathname.

alt
file.setIconPos

file.setIconPos (pathname, horiz, vert)

Sets to horiz and vert the components of the icon position of the file or folder at pathname.

alt
file.setLabel

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.

alt
file.setModified

file.setModified (pathname, date)

Sets to date the modification date of the file or folder at pathname.

alt
file.setPath

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.

alt
file.setType

file.setType (pathname, string4)

Sets to string4 the string4 type code of the file at pathname.

alt
file.setVersion

file.setVersion (pathname, versionString)

Sets to versionString the version string of the file at pathname.

alt
file.setVisible

file.setVisible (pathname, visible?)

Sets the visibility of the file or folder at pathname according to the boolean visible?.

alt
file.size

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.

alt
file.sureFolder

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.

alt
file.type

file.type (pathname)

Returns the string4 type code of the file at pathname.

alt
file.unlock

file.unlock (pathname)

Unlocks the file or folder at pathname.

alt
file.unmountVolume

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.

alt
file.visitFolder

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.

alt
file.volumeBlockSize

file.volumeBlockSize (volumePathname)

Returns the block size, in bytes, of the volume at volumePathname.

alt
file.volumeFromPath

file.volumeFromPath (pathname)

Returns the first element of the pathname string pathname.

alt
file.volumeSize

file.volumeSize (volumePathname)

Returns the total number of bytes in the volume at volumePathname.

alt
file.write

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.

alt
file.writeLine

file.writeLine (pathname, whatToWrite)

Same as file.write() except that whatToWrite is first coerced to a string and cr is appended to it.

alt
filemenu.close

filemenu.close ()

Closes the frontmost window.

alt
filemenu.closeAll

filemenu.closeAll ()

Closes all open windows, not including the Main Window, unless the Main Window is frontmost.

alt
filemenu.new

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.

alt
filemenu.open

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.

alt
filemenu.save

filemenu.save ()

Saves the database.

alt
filemenu.saveCopy

filemenu.saveCopy (pathname)

Saves the database in compact form to a file at pathname.

alt
finderflags.clear

finderflags.clear (pathname, whichBit)