Link Expressions
This illustrates examples of link expressions that can be used in Newt's Cape 1.5e (or greater).
Currently, this assumes that the book is standalone, or
that Newt's Cape is installed and NewtonScript compile is on.
advmeta.htm illustrated simple use of appSymbol as a link to open an installed application.
This has been extended to include a message and parameters (or global function). For more complicated
behavior, you can define links which are methods.
The basic formats are:
- appSymbol
- toggle an application (opens or closes). same appSymbol/toggle (see next)
- appSymbol/message
- sends a message (with no parameters) to an application
- appSymbol/message?param1,param2,param3
- sends a message (with 3 parameters) to an application
- appSymbol/message?slot1=value1&slot2=value2
- sends a message with 1 frame parameter to an application;
this format is provided for "compatibility" with CGI scripts\
(though it does not do any conversion of URL encoded quoted values).
this is the same as appSymbol/message?{slot1: value1, slot2: value2}.
currently, there would be a problem if you wanted to use = or & characters
in either format
- function?param1,param2,param3,param4
- call a global function (with 4 parameters)
- function?slot1=value1&slot2=value2&slot3=value3&slot4=value4
- call a global function with 1 frame parameter
Examples:
(note: Print examples assume NTK Inspector(Connected), NewtDevEnv(Print? on) or Sloup(Inspect? on)
- Print?3+4 function with single parameter
-
Print?{a: 3, b: nil, c: "a string", d: 'foo, e: sin(3.1415926)} function with single frame parameter
-
Print?a=3&b=nil&c="a string"&d='foo&e=sin(3.1415926) function with single frame parameter (URLencoded format)
-
PlaySound?@102 play "fun beep" sound
- root/sysBeep system beep (no parameters)
-
root/Notify?3,"a title!","a message" app/method with 3 parameters
-
calendar/AddAppointment?"a Newt's Cape meeting",time(),60,nil,nil add an appointment (5 parameters)
- open Dates
-
worldclock/setLocation?GetCityEntry("Seattle")[0] set location to city (Seattle)
- open Time Zones
-
paperroll/MakeTextNote?"a Newt's Cape note",true add a new Note
- open Notes
This document (in all its formats) is © 1997-2007.
Steve Weyer. All Rights Reserved Worldwide.
You are free to incorporate this into your own documents,
but I would appreciate an acknowledgement of Newt's Cape and the example.
Last updated: Dec 2000