Your browser doesn't support Javascript.

Please follow this link for a leaner version of this website

Scriptdigital.com
Frontier Newbie Toolbox

image FNT en français

Frontier Newbie Toolbox

Table of Contents

Exploring Frontier

Get Start Tools

Web Site Management

Learning UserTalk

Edito

News

  
Learning UserTalk

What's on this Page :

 

http://www.jetlink.net/~mattn/scriptingtutorial/

This tutorial is from Matt Neuburg (yes, him again--no, I don't have an obsession with Matt). I guess that if you have read other sections in The Frontier Newbie Toolbox, you know now who he is.This is the latest version updated by the author (the version on scripting.com is updated by Brent Simmons of UserLand). This tutorial will lay out a very good foundation for UserTalk, and what is programming/scripting in general (UserTalk is close to C--no don't be afraid--and uses a syntax that is close to every programming language beside AppleScript which is a very special case).

Also, this tutorial will help you to "get out" of the Frontier space and speak, with the help of Frontier, to the file system of your computer (reading from files, writing to them, creating new files, etc.), and, up to a point, will give you an idea how to manipulate other applications.

Again, the title of each chapter is usually self-explanatory (at least for those who have a little bit of background programming/scripting knowledge; for the others, read the tutorial and you will get to this level). Here are the chapters that constitute this tutorial:

  • About This Tutorial
  • What Does Frontier Do?
  • Keywords, Handlers, Verbs, and Calls
  • Loops, Variables, Parameters, and Conditionals
  • The Handler Rule
  • Returns, Addresses, and Dereferencing
  • Scope and With
  • Strings and Files
  • Outlines and Tables
  • Running, Debugging, and Getting Help
  • Datatypes
  • A Real-Life Problem
  • String Parsing and Substitution
  • Manipulating Files and Folders
  • Final Touches

The tutorial is grosso modo split in three parts. The first part ("About This Tutorial", "What Does Frontier Do?") is a broad presentation of the intention of the tutorial, and the power of Frontier as a central command post for your computer. The second part starting from the chapter "Keywords, Handlers, Verbs, and Calls" to the chapter "Datatypes" gives you the foundation of UserTalk, and how to use Frontier to write scripts. The last part of the tutorial from the chapter "A Real-Life Problem" to the end, is a practice of what you learned in the previous chapter via the building of a website, and elaborates on the string verbs.

Here is some of the UserTalk verbs that you will see :

  • clock.now()
  • clock.waitseconds ()
  • defined ()
  • dialog.getInt()
  • dialog.notify()
  • edit ()
  • exists ()
  • file.copy ()
  • file.emptyFolder ()
  • file.filefrompath()
  • file.getFolderDialog()
  • file.getPathChar()
  • file.isFolder ()
  • file.putFileDialog()
  • file.read()
  • file.readWholeFile()
  • file.sureFolder ()
  • file.writeWholeFile()
  • fileloop ()
  • getBinaryType()
  • getInt()
  • html.processMacros ()
  • html.processMacros()
  • loop ()
  • msg()
  • new()
  • op.insert()
  • op.setLineText ()
  • op.wipe()
  • string ()
  • string.countFields()
  • string.delete ()
  • string.deleteNthField()
  • string.NthField()
  • string.popLeading ()
  • string.popTrailing()
  • string.replace ()
  • string.replaceAll ()
  • strings ()
  • sys.os()
  • target.set ()
  • trigCmd.sqrt()
  • typeOf()
  • webbrowser.bringToFront ()
  • webbrowser.openDocument ()
  • window.about()
  • wp.setText()

 

http://www.scripting.com/frontier5/manual/default.html

The User's Manual, written by Dan Shafer for version 1.0 of Frontier was recently updated for Frontier 5. You already read, I suppose, the chapters that I suggested, so now it's time to get your feet wet and read the remaining. As I said, one of the cool things about this tutorial is that it is full of links to other documentation on scripting.com. On the other hand, it gets really dense sometimes, and sometimes fall short of explanation. But I still think that you should read it. The User's Manual also covers how Frontier can drive other applications a little bit more.

Here are the remaining chapters that you should read :

  • Chapter 3: Writing Frontier Scripts
  • Chapter 4: The UserTalk Language
  • Chapter 5: Scripting Other Applications
  • Chapter 8: Scripting the Operating System

Chapter 3 "Writing Frontier Scripts" is very nice, has a lot of screenshots, and is a very good complement to the chapter "Running, Debugging, and Getting Help" in Matt's tutorial. It will show you all aspects of writing scripts in Frontier; how indentation works, why the name of the script is important, how to use the debugger. I think that it is one of the best chapters in the whole tutorial, along with chapter 8 "Scripting the Operating System".

Chapter 4 "The UserTalk Language" is very dense, and lacks explanations. You have here in one chapter what was expanded in a whole tutorial in Matt's tutorial. But on the other hand, it's a fast way, if you have programming/scripting background, to get the essentials. And it also has very nice tables describing UserTalk. Look at Table 4.1 Verbs Summary which explains each category of verbs (clock verbs, file verbs, string verbs, etc.) and links them to DocServer, or jump to Table 4-2 UserTalk Operators (but unfortunately here, there is no link to to DocServer). Table 4-3 Other Special Characters is also very useful to know what are the meanings of characters like the brackets, t, n and so on in UserTalk context, and you might want to have a quick look at Table 4-4 Common UserTalk Datatypes. (The first page of DocServer is similar.) It can also help you to figure out the Usertalk verbs and keywords categories. But unfortunately, when you follow the links to those categories, the page that lists them have no explanations about them whatsoever!

Chapter 5 "Scripting Other Applications" is for now Mac-centric and has a serious problem (not because of the former, though!). Why is it so? Because the majority of the chapter uses as its example the nice application BartChart made by UserLand (it create colored charts, you have it in your Frontier Macintosh Folder in the UserLand Utilities folder). BartChart is only scriptable by Frontier (if you drop the application on the Script Editor, it will tell you that this application is not "scriptable"), and uses some verbs (the verbs at system.verbs.builtins.app) that came from the time preceding AppleScript and Apple's object model (yeah ! Frontier was ahead of Apple then), and that are totally deprecated today (unless you use BartChart, Ubase and MacBird, I think). Ok, those verbs are very close to the actual verbs that you can use with a scriptable application, but I think it can only confuse a Frontier Newbie.

Also, you don't even get an explanation of the Object Model (a syntax to drive applications) and how to create Glue (a set of verbs automatically created by the badly named suite.commercial, and based on the scriptability of the application, its "aete" resource--you can have a look here if you want to know more, but I think it will be more confusing than useful).

Unfortunately, on this very topic of driving other applications via Frontier, there is no good online tutorial for a Frontier Newbie. And that's a pity, because this one of the major strengths of Frontier. And unless you have The Book that cover this aspect at length, and is very good at it, you have to check the many glues that ship with Frontier (in system.verbs.apps) or that you can obtains from third parties (see DOODADS, and ScriptBits for that).

If you are interested in this topic check out this map of the old Frontier 4 web site while it still there. See for example the page Frontier and the Object Model ( mentioned on this map).You can find other interesting stuff there, even if part of the info can be outdated, like the page List and Record that has not yet migrated to the Frontier 5 web site). Also, on the Object Model page, you can read the Object Model Tutorial from Brian Andressen of Halo and Blox fame, but be careful; in the terms of the author, this is a "hastily-done tutorial".

Chapter 8: "Scripting the Operating System" is a good and a light introduction for doing neat stuff with Frontier and your computer. It nicely introduces the UserTalk verbs that interact with your OS (Mac and Windows) and has an example script for each platform. A must read for a Frontier Newbie.

Some of the verbs that are covered by the User's Manual :

  • clock.waitSeconds ()
  • defined ()
  • dialog.alert ()
  • dialog.ask ()
  • dialog.ask()
  • dialog.notify ()
  • dialog.notify()
  • edit ()
  • file.delete ()
  • file.endOfFile ()
  • file.exists ()
  • file.folderFromPath ()
  • file.getFileDialog ()
  • file.getSpecialFolderPath ()
  • file.new ()
  • file.newAlias ()
  • file.open ()
  • file.readLine ()
  • file.setCreator ()
  • file.setType ()
  • file.volumeSize ()
  • file.writeWholeFile ()
  • fileloop ()
  • finderMenu.getSelectionList ()
  • msg ()
  • return ()
  • scriptError ()
  • string ()
  • string.upper ()
  • sys.os ()
  • window.about ()
  • window.getPosition ()
  • window.msg ()

 

http://www.scripting.com/frontier5/topics/

This short tutorial is not linked directly on the Frontier 5 site, but I think that the User's Manual links to part of it. It's not really on UserTalk, but very close to it. I'm not sure, but I think the tutorial is from Daniel Berlinger and Brent Simmons, the Lone Ranger of UserLand. Brent has written a couple of fine tutorials (his tutorial on MacBird , a Frontier Graphical User Interface tool on the Mac, is in my opinion the best on the subject), and had the unrewarding duty to update documentation from others.. You will find interesting information in this tutorial on agents and desktop scripts.

 

http://www.scripting.com/frontier5/howtos/default.html

An other tutorial that is not linked directly on the Frontier 5 site. Its from Brent Simmons and its here because it explain how to create droplet with Frontier. Droplets in the words of the author are "double-clickable applications that have an embedded script that runs once for each file, folder or disk icon that's dragged onto the app". The tutorial cover also how Frontier can work with AppleScript and what's in the UserLand Utilities folder in the Frontier folder.

   
 
PreviousNext Next : Edito | Top
  
  

Dernière mise à jour: Mardi, le 22 juin 1999.
http://scriptdigital.com/fnt/learningUserTalk.html
Produit sur Macintosh.
Créé avec Frontier 5.
   

©Emmanuel M. Décarie
Création, intégration et gestion de sites webs avec Frontier.
UserLand, Frontier, and UserLand Frontier are trademarks of UserLand Software, Inc. Some of the images are © UserLand SoftWare, Inc. The Workspace.Compendium and The Frontier Newbie Toolbox are independent projects by Emmanuel M. Décarie and are not associated with UserLand Software, Inc.
Éperon