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

47

Apple Event Suites

This chapter provides reference information for the verbs described under "Apple Event Suites" in Chapter 32, Driving Other Applications.

alt
core.close

core.close (appID, whatObject, [saving?, savingIn])

Closes whatObject. The values for saving? are yes, no, and ask; the default is no.

theApp = "Scriptable Text Editor"
with objectModel
    core.close(theApp, window[1])

alt
core.count

core.count (appID, container, whatToCount)

Returns the number of whatToCounts (some type of element) in container. If there is no container, pass null.

theApp = "Finder"
with objectModel, finder
    msg(core.count(theApp, null, disk))

alt
core.create

core.create (appID, whatClass, [data, propertyList, where])

Makes a new whatClass (some type of element). This concept is sometimes called "make" in other literature.

alt
core.dataSize

core.dataSize (appID, whatObject, [whatType])

Returns the size of the data of whatObject; whatType says what type of object whatObject should be considered as, because this can make a difference to the size of its data.

theApp = "Scriptable Text Editor"
with objectModel, window[1]
    msg(core.dataSize(theApp, word[4], text))
        « 4, because that's how many letters it has
    msg(core.dataSize(theApp, word[4]))
        « 58, because it includes style information

alt
core.delete

core.delete (appID, whatObject)

Deletes the element whatObject.

alt
core.duplicate

core.duplicate (appID, whatObject, toWhere)

Makes a copy of the element whatObject at toWhere. This concept is sometimes called "clone" in other literature.

theApp = "Scriptable Text Editor"
with objectModel, document[1]
    core.duplicate(theApp, word[2], after(word[3]))

alt
core.exists

core.exists (appID, whatObject)

Returns a boolean reporting whether whatObject exists.

alt
core.get

core.get (appID, whatObject, [whatType])

Returns the data of whatObject; whatType says what type of object whatObject should be considered as.

theApp = "Scriptable Text Editor"
with objectModel, window[1]
    msg(core.get(theApp, word[4], text))
        « "time"
        « if we omit the third parameter, we get a mess...
        « because of the style information

alt
core.getAs

core.getAs (appID, whatObject, whatType)

Identical to core.get() except that whatType isn't optional.

alt
core.move

core.move (appID, whatObject, toWhere)

Moves the element whatObject to toWhere.

alt
core.open

core.open (appID, whatObject)

Opens whatObject.

alt
core.print

core.print (appID, whatObject)

Prints whatObject.

alt
core.quit

core.quit (appID, [saving?])

Quits the application; possible values for saving? are yes, no, and ask, and the default is ask.

alt
core.save

core.save (appID, whatObject, [filePathname, fileType])

Saves to disk. fileType is a string4 type code. There is a bug in the glue; the filePathname is coerced to an alias, when it should be coerced to a fileSpec. This is true for the save() and saveAs() of just about all application glue as well.

alt
core.saveAs

core.saveAs (appID, whatObject, filePathname, [fileType])

Identical to core.save() except that filePathname isn't optional.

alt
core.set

core.set (appID, whatObject, toWhat)

Sets the value of whatObject to toWhat. A powerful command, the commonest way of getting real work done. This example boldifies the selected stretch of text.

local (theApp = "Scriptable Text Editor")
with objectModel, STE « Scriptable Text Editor glue
    stylRec = {onStyles:{bold}, offStyles:{}}
    core.set(theApp, selection.style, stylRec)

alt
misc.beginTransaction

misc.beginTransaction (appID)

Asks the application to start a transaction and to return a transactionID.

alt
misc.copy

misc.copy (appID)

Like choosing Copy from the application's Edit menu. Most applications must be frontmost for this command to work.

alt
misc.createPublisher

misc.createPublisher (appID, whatObject, whatFile)

Causes the application to make a publish-and-subscribe publisher of whatObject in the edition file whatFile.

alt
misc.cut

misc.cut (appID)

Like choosing Cut from the application's Edit menu. Most applications must be frontmost for this command to work.

alt
misc.doMenu

misc.doMenu (appID, whatMenuItem)

Like choosing whatMenuItem. In this example, we ask FileMaker Pro to boldify the currently selected text.

theApp = "FileMaker Pro"
with objectModel
    misc.doMenu(theApp, menu["Style"].menuitem["Bold"])

alt
misc.doScript

misc.doScript (appID, string)

Causes the application to execute a script in its internal scripting language.

alt
misc.editGraphic

misc.editGraphic (appID, graphicArea)

Tells the application to open graphicArea for editing, so that the user can edit it; when the user has finished the editing session, returns the edited graphic.

alt
misc.endTransaction

misc.endTransaction (appID, transactionID)

Asks the application to end a transaction. This is the only verb in the database that calls transactionEvent().

alt
misc.imageGraphic

misc.imageGraphic (appID, graphic, format, antialiasing?,
                     dithering?, rotationRec, scale, 
                     translationPoint, flipHorizontal?, 
                     flipVertical?, quality, 
                     structuredGraphic?)

Performs a graphic image conversion. All but the first three parameters are optional. The format is a string4 type code such as 'EPS ', 'PICT', or 'TIFF'. The quality can be draft, high, or regular. To avoid passing large amounts of data, both the graphic and the result can be an alias to a file.

alt
misc.isUniform

misc.isUniform (appID, whatObject, whatProperty)

Returns a boolean telling whether the object(s) whatObject all have the same value for the property whatProperty.

alt
misc.paste

misc.paste (appID)

Like choosing Paste from the application's Edit menu. Most applications must be frontmost for this command to work.

alt
misc.redo

misc.redo (appID)

Like choosing Redo from the application's Edit menu.

alt
misc.revert

misc.revert (appID, whatObject)

Reverts the object whatObject to its most recently saved state.

alt
misc.select

misc.select (appID, whatObject)

Causes whatObject to become the current selection. A shorthand for using core.set() with direct object selection.

theApp = "Scriptable Text Editor"
with objectModel
    misc.select(theApp, window[1].word[2])
    « same as saying:
    « core.set(theApp, selection, window[1].word[2])

alt
misc.show

misc.show (appID, whatObject, [whatWindow, whatPoint])

Asks that the object whatObject be brought into view.

alt
misc.undo

misc.undo (appID)

Like choosing Undo from the application's Edit menu.

alt
required.openApplication

required.openApplication (appID)

Sent to an application immediately after it is started up. Tells the application to perform its initialization tasks, such as opening an empty document. Apple Computer says that you should never call this verb (only the Finder may do so).

alt
required.openDocument

required.openDocument (appID, documentPathname)

Sent to an application when the user opens one of its documents in the Finder; if the application wasn't running, sent instead of required.openApplication(). Tells the application to open the document.

alt
required.printDocument

required.printDocument (appID, documentPathname)

Sent to an application when the user selects one of its documents in the Finder and chooses Print from the Finder's File menu. Tells the application to print the document.

alt
required.quitApplication

required.quitApplication (appID)

Sent to an application when the Finder wants it to quit (for example, because the user has chosen Shut Down from the Special menu). Tells the application to perform any shutdown tasks, then terminate.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


TOP UP: Reference

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.