on clear () { delete selection
	return (appleEvent (Arch.id, 'core', 'delo'))}

on close () { close the front window
	return (appleEvent (Arch.id, 'core', 'clos'))}

on closeall () { close all the windows
	return (appleEvent (Arch.id, 'core', 'Clos'))}

on copyclip () { copy selection
	return (appleEvent (Arch.id, 'core', 'copy'))}

on cut () { cut selection
	return (appleEvent (Arch.id, 'core', 'cut '))}

on fetch (file, host = nil, path = nil, name = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil, binary = nil, expandWith = nil) { fetch a file via ftp
	return (appleEvent (Arch.id, 'Arch', 'Ftch', '----', alias (file), 'FTPh', string (host), 'FTPc', string (path), 'pnam', string (name), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks), 'ArGB', boolean (binary), 'ArGE', string4 (expandWith)))}

on find (s, server = nil, matches = nil, caseSensitivity = nil, regularExpression = nil, url = nil, window = nil) { query archie server
	return (appleEvent (Arch.id, 'Arch', 'Find', '----', string (s), 'ArFS', string (server), 'ArFM', long (matches), 'ArFC', boolean (caseSensitivity), 'ArFR', boolean (regularExpression), 'ArUR', string (url), 'ArFW', boolean (window)))}

on frontwindowrecord () { returns the record for the front window
	return (appleEvent (Arch.id, 'Arch', 'Afwr'))}

on geturl (s, geturlTo = nil) { fetch the url and display or save it
	return (appleEvent (Arch.id, 'GURL', 'GURL', '----', string (s), 'dest', filespec (geturlTo)))}

on help () { open the help window
	return (appleEvent (Arch.id, 'core', 'help'))}

on index (host = nil, path = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil) { Display an index listing
	return (appleEvent (Arch.id, 'Arch', 'Indx', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks)))}

on isRunning () {
	return (sys.appIsRunning (Arch.id))}

on launch () {
	return (app.startWithDocument ("Arch", ""))}

on list (file, host = nil, path = nil, name = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil, window = nil) { list files in a directory
	return (appleEvent (Arch.id, 'Arch', 'List', '----', alias (file), 'FTPh', string (host), 'FTPc', string (path), 'pnam', string (name), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks), 'ArFW', boolean (window)))}

on macsearch (s) { search the Ambrosia server for Mac files
	return (appleEvent (Arch.id, 'Arch', 'PQry', '----', string (s)))}

on mkdir (host = nil, path = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil) { Make directory
	return (appleEvent (Arch.id, 'Arch', 'MkDr', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks)))}

on nlist (file, host = nil, path = nil, name = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil) { list names of files in a directory
	return (appleEvent (Arch.id, 'Arch', 'NLst', '----', alias (file), 'FTPh', string (host), 'FTPc', string (path), 'pnam', string (name), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks)))}

on open (file) { open bookmark or folder
	return (appleEvent (Arch.id, 'aevt', 'odoc', '----', alias (file)))}

on openDocument (file) {
	return (required.openDocument (Arch.id, file))}

on paste () { paste into selection
	return (appleEvent (Arch.id, 'core', 'past'))}

on printDocument (file) {
	return (required.printDocument (Arch.id, file))}

on quit () { Quit Anarchie
	return (appleEvent (Arch.id, 'aevt', 'quit'))}

on remove (host = nil, path = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil) { delete a file or directory
	return (appleEvent (Arch.id, 'Arch', 'Rmve', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks)))}

on rename (host = nil, path = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil, newname) { rename file or directory
	return (appleEvent (Arch.id, 'Arch', 'Rena', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks), 'NewN', string (newname)))}

on selectall () { select all
	return (appleEvent (Arch.id, 'core', 'slct'))}

on sendcommand (host = nil, path = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil) { Send a raw FTP command
	return (appleEvent (Arch.id, 'Arch', 'SCmd', 'FTPh', string (host), 'FTPc', string (path), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks)))}

on showabout () { open about menu
	return (appleEvent (Arch.id, 'core', 'abou'))}

on showarchie () { open the archie input window
	return (appleEvent (Arch.id, 'Arch', 'SArI'))}

on showget () { open the fetch input window
	return (appleEvent (Arch.id, 'Arch', 'SFcI'))}

on showlog () { open the log window
	return (appleEvent (Arch.id, 'Arch', 'SLog'))}

on showmacsearch () { open the MacSearch input window
	return (appleEvent (Arch.id, 'Arch', 'SMSI'))}

on showtips () { open the Tips window
	return (appleEvent (Arch.id, 'Arch', 'STip'))}

on showtranscript () { open the transcript window
	return (appleEvent (Arch.id, 'Arch', 'STrn'))}

on store (file, host = nil, path = nil, name = nil, user = nil, password = nil, url = nil, viaFirewall = nil, viaSocks = nil, binary = nil) { store a file to an ftp site
	return (appleEvent (Arch.id, 'Arch', 'Stor', '----', alias (file), 'FTPh', string (host), 'FTPc', string (path), 'pnam', string (name), 'ArGU', string (user), 'ArGp', string (password), 'ArUR', string (url), 'ArGF', string (viaFirewall), 'ArGS', string (viaSocks), 'ArGB', boolean (binary)))}

on undo () { undo the last operation
	return (appleEvent (Arch.id, 'core', 'undo'))}

on updateserverlist () { Download the server lists and update Internet Config
	return (appleEvent (Arch.id, 'Arch', 'UpSL'))}

