Part of the Samples Website. 8/16/97.


«Adds a file to the Apple menu
«prompt the user to select the file, by passing 0 as the file type, we get a list of all files
«the funny character in the prompt is option-shift-k, the Apple symbol in Chicago font
«For another example of an alias script, see p.146-148 Frontier User Guide.
local (f = "")
if file.getFileDialog ("Select an item to add to the [apple] menu.", @f, 0)
local (destfolder = file.getSpecialFolderPath ("", "Apple Menu Items", false))
local (destfile = destfolder + file.fileFromPath (f))
if file.exists (destfile) «must delete the file first, or file.newAlias will fail
if not dialog.confirm ("OK to delete existing file?")
file.delete (destfile)
file.newAlias (f, destfile)

This page was last built on Sat, Aug 16, 1997 at 6:31:47 PM. You can download the current set of sample scripts from our FTP site. Dave