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

samples.basicStuff.microEditor

«A quick editor script you can invoke from the Apple menu
«assign this script to a QuicKey...
«or call it from a script in your Apple Menu Items folder
«run it when you need to write a little text
«a dialog pops up, asking you to enter a title for your text
«it's added to a table named "microEditorDocs" in your people table
«as time goes by, you'll accumulate a trail of little bits of text
local (adrtable = @people.[user.initials].microEditorDocs)
local (adr) «the address of the wptext window to edit
bundle «set value of adr
if not defined (adrtable^)
new (tabletype, adrtable)
if not defined (adrtable^.lastdocname)
adrtable^.lastdocname = "First Document"
if not dialog.ask ("Enter document name:", @adrtable^.lastdocname)
return
adr = @adrtable^.[adrtable^.lastdocname]
on newdoc ()
new (wptexttype, adr)
target.set (adr)
editMenu.paste ()
editMenu.selectAll ()
editMenu.setFont ("Monaco")
editmenu.setFontSize (12)
window.zoom (adr)
target.clear ()
edit (adr)
if defined (adr^)
speaker.beep ()
local (s = "Replace existing document named "" + adrtable^.lastdocname + ""?")
case dialog.threeWay (s, "Replace", "Cancel", "Edit")
1 «user pressed Replace
delete (adr)
newdoc ()
2 «user pressed Cancel
return
3 «user pressed Edit
edit (adr)
else
newdoc ()
Frontier.bringToFront ()
Frontier.findertofront = false


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