Satimage
Dictionary of Smile
Home The dictionaries Dictionary of Smile  
Standard Suite
Smile
Smile text suite
Smile files and folders suite
Smile scripted scripting
Smile drawings Suite
SmileLab Suite
Smile over IP
Smile IO devices
Web Suite
Standard Suite
Common terms that most applications should support

close v : Close an object.

close reference : the object to close.

[saving yes | no | ask] : Specifies whether changes should be saved before closing.

count v : Return the number of elements of a particular class within an object.

count reference : the object whose elements are to be counted

[each type] : the class of objects to be counted.

→ integer : the number of elements

delete v : Delete an object.

delete reference : the object to delete.

get v : Get the data for an object.

get reference

anything

make v : Make a new object.

make

new type : the class of the new object.

[at location reference] : the location where to insert the object.

[with properties record] : the initial values for properties of the object.

→ reference : the new object

open v : Open an object.

open alias : the file(s) to open.

quit v : Quit an application.

quit

[saving savo] : specifies whether to save currently open documents

save v : Save an object.

save reference : the object to save, usually a window.

[in file specification] : the file in which to save the object.

[as string] : a four-characters string specifying the file type in which to save the data.

set v : Set an object's data.

set reference

to anything : the new value.

anything

Smile

basic object n : generic class which has the properties owned by each object

properties

class type, r/o

name string

id integer, r/o : the unique id number

container reference, r/o : the object it belongs to

named reference reference, r/o : a reference by name

bounds bounding rectangle

path name file specification

visible boolean

drawing boolean : does the object draw its result?

class script script : the script shared by all objects of the same class

script script : the personal script of the object

extras anything : any user data

volatile extras anything : any temporary user data (not saved within the object)

extension file string : the name of the file containing the external code for the object

current dialog integer : the id number of the information window for the object

want idle boolean : does its script receive an 'idle' callback on idle events?

idle delay real : delay between idle events in seconds

properties record : the properties of the object

whole record, r/o : the properties and elements of the object

application n [inh. basic object] : the application program

elements

contains windows, text windows, script windows, web windows, Unicode windows, graphic windows, dialogs, IO devices, menus, menu commands, movie windows.

properties

creator type type, r/o

version integer, r/o

cursor arrow | watch | busy

screen bounds bounding rectangle, r/o

user folder file specification, r/o : the folder related to the Scripts menu

user script file file specification, r/o : the currently running script file

context script, r/o : the class script of the basic object class

globals script, r/o : the script of the permanent global variables

drawing context string

dictionary string, r/o : the dictionary of the application

modifiers list of command down | option down | control down | shift down | caps lock down, r/o

clipboard anything : can contain text, references etc.

findclipboard string

recording boolean : toggled to record scripts

console reference : the text window for recording

chrono real : the time elapsed (in seconds) since the last "chrono" call

mouse location point

mouse button boolean

background boolean

menu bar visible boolean

serial ports list of string, r/o : A list of info for each serial device. This info is a list {kind, UNIX path, name}. kind=9 means RS232.

WebCacheModel integer : 0 (no cache) for development, 1 for browsing

WebLoadsImages boolean

WebPluginsEnabled boolean

WebAlertEnabled boolean

window n [inh. basic object] : generic window

elements

contained by application.

properties

visible boolean : (making a window invisible also sends it behind every other window)

corner list of integer : {left, top}: the upper left corner of the window in screen coordinates

text font string : the name of the font or its id number

text size integer

width integer : the width

height integer : the height

collapsed boolean

closeable boolean : does the window have a close box?

resizable boolean : is the window resizable?

zoomable boolean : is the window zoomable?

has title bar boolean : has the window a title bar?

autohide scroll bars boolean

modified boolean : is the window modified

never save boolean : when the user closes the window, don't ask for saving the changes

toolbar visible boolean

message bar string, w/o : the text of the toolbar (write only)

text window n [inh. window > basic object]

elements

contains character, word, paragraph, text; contained by application.

properties

selection list of integer : the selection range, or the selected text (as text)

line width integer

fit to window boolean : adjust text to window width

tab width integer

scripting language string : the default scripting language

console reference : the text window for output (default: the same window)

store undo boolean : true-false to encapsulate complex operations avoiding ridiculous undo's

update screen boolean : false-true to encapsulate complex operations avoiding lengthy text calculations

script window n [inh. text window > window > basic object]

elements

contained by application.

Unicode window n [inh. text window > window > basic object] : Suitable to handle cross-platform files like xml and html files. See the help for more info.

elements

contained by application.

text n, pl text

elements

contained by text windows.

properties

text size integer

text font text : the font name or index

text color RGB color : a list, e.g. {0,0,0} for black

style text style info

length integer

index integer : the index of the first character of the text in its window

boundaries list of integer : the text range as a list of 2 integers

paragraph index integer

word index integer

dialog n [inh. window > basic object]

elements

contains dialog items; contained by application.

properties

tagged data record : the contents of the dialog items, by keyword

modal boolean : does the dialog have to be closed before any new user action?

floating boolean : Does the window float? Can be set only when creating the dialog.

utility window boolean : Does the window float above the windows of all applications? Can be set only when creating the dialog.

focus reference : the active item

mode boolean : is the dialog in edit mode?

owner reference : (advanced)

want keydown boolean : if true, receive 'keydown' events instead of handling key events.

window opacity real

dialog item n [inh. basic object]

elements

contained by dialogs.

properties

enabled boolean

contained data anything : contents of the item

control kind integer : the control type as in control manager

call script boolean : does it trigger a "click in" call to the script of the dialog?

number formatting string

accept return boolean : does the dialog item (editable text) accept new line entries?

tag string : an optional sequence of 4 characters identifying the item in the record returned by tagged data

icon ID string : an sequence of 4 characters identifying the icon (defined by MacOS or with the 'register icon' command

tooltip string : a text displayed when the cursor is holded a short time over the dialog item

bindings list of boolean : the bindings {top, left, bottom, right} of the control with respect to its container

selection list of integer : the indexes of the selected items in a list or browser control

menu list of string : the menu of a popup menu button

editable boolean : are the cells of a list box/databrowser editable?

formatter record : a list of {kind:(string|boolean), width:x, name:theName} defining the columns of a databrowser. If kind is boolean the column contains check boxes. The contained data property must be be set to a list of list of strings and booleans accordingly

movie window n [inh. window > basic object]

elements

contains movie frame; contained by application.

properties

frame rate real : 1.0: normal rate

image matrix, r/o : the current frame as a matrix, only available with gray levels

current frame integer

current time real

duration real

menu n

elements

contains menu items; contained by application.

properties

name string

enabled boolean

menu item n

elements

contained by menus.

properties

name string

enabled boolean

checked boolean

modifiers list of command down | option down | control down | shift down | caps lock down

shortcut string

menu command n : same as menu item, but access is by command id

elements

contained by application.


prepare e : event sent by the application when an object is created

prepare reference : the newly created object

do menu e : event sent by the application when a menu item is selected

do menu string : the code (4 characters) or name of the command

to reference : the target of the command

do contextual menu e : event sent by the application when a contextual menu item is selected

do contextual menu string : name of the item

to reference : the target of the command

click in e : event generated by a click in a control. This event is sent to the script of the control's container.

click in reference : the container of the control

item number integer : the 1-based index of the control

acquire focus e : event generated when a control acquires the focus. This event is sent to the script of the control's container.

acquire focus reference : the container of the control

item number integer : the 1-based index of the control

loose focus e : event generated when a control looses the focus. This event is sent to the script of the control's container.

loose focus reference : the container of the control

item number integer : the 1-based index of the control

databrowser edited e : event generated when a cell in a databrowser has been modified

databrowser edited reference : the databrowser

at reference : the coordinates {i,j} of the cell

activated e : event sent to windows on activation

activated window

deactivated e : event sent to windows on deactivation

deactivated window

drop e : event generated by dropping

drop anything : the dropped object

onto reference : the destination object

[at point] : the drop coordinates

export e : return a description for the object to export

export reference : the object

anything

store e : sent by the application just before saving an object

store reference : the object being saved

notify e : generic command to communicate between objects.

notify reference : the recipient object

[from reference] : the sender

with data anything : the message

[with delay real] : seconds

switched to e : event send to the context when the frontmost application changes

switched to string : name of the new frontmost application

add library v : augment a script with the contents of a text or compiled script file.

add library alias : a text file or a (not run-only) script file or a string

[using reference] : a reference to a script. Default: the Smile's context

draw v : draw an object

draw reference

postit v : display a string in a small floating window (use "" to dismiss the window)

postit string

show alert v

show alert string

[kind integer] : 0 stop alert, 1 note alert, 2 caution alert, 3 plain alert

show sheet v

show sheet string

[kind integer] : 0 stop alert, 1 note alert, 2 caution alert, 3 plain alert

at reference : a window

reveal v : Bring the specified object(s) into view

reveal reference

smilepause v : wait until the right arrow key is pressed or the delay is elapsed or "smileresume" is called. Press escape or cmd-period to trigger a "User canceled" error.

smilepause [real] : the timeout in seconds

[until escape key boolean] : abort if escape key pressed, default: true

[until arrow key boolean] : return if arrow key pressed, default: false

smileresume v : cancel a "smilepause"

smileresume

Smile text suite

measuretext v : return the sizes of a string as the Graphic Library will draw it

measuretext string : the text to measure: must be a single line (not containing a CR)

[font record] : specify text size and font (and optionally text spacing and line spacing), ex: {text font:"Arial", text size:40, text spacing:3, line spacing:1.1}

[latex boolean] : if true, translate _, ^, \\alpha ... as in LaTeX. Default: true

→ list of real : the box enclosing the text: {x,y,width,height}, relative to the current text position

Example
measuretext "turn left \\hookleftarrow" font {text font:"Arial", text size:40, text spacing:3, line spacing:1.1} with latex -- {1.5, -10.0, 217.51171875, 49.0}

breaktext v : break a string into an array of strings fitting a given line width.

breaktext string : the text to break

length real : the maximum length of the lines (in pixel)

[font record] : specify text size and font as in the measuretext command.

[latex boolean] : if true, translate _, ^, \\alpha ... as in LaTeX. Default: true

→ list of string

extractcolumn v : extract columns out of an array. The array may be supplied as a tabulated text, or as a matrix.

extractcolumn integer : the column index (or a list of column indexes)

[thru integer] : the last column

in anything : a file, a string, or a matrix

[as type] : requested type for the result: string, array of real, or matrix. Default is array of real when the in parameter is a matrix, or string otherwise

[skipping integer] : number of lines to skip

[nrows integer] : maximum number of rows to extract

[encoding string] : if parameter "in" is a file. The string must be one of those returned by 'textencodings'

[separator string] : the character separator

→ string : the columns

Example
set f to alias "mypath:myfile.txt" --get row indices and columns 1 and 2 from the file f, skipping the three first rows: set {C0, C1, C2} to extractcolumn {0, 1, 2} in f skipping 3 encoding "ISO-8859-1"

localize v : (advanced) by default, returns the localized string as found in the "Smilelocalized.strings" file of the current ".lproj" folder

localize string

[in alias] : path to a bundle. Default: the Smile.app bundle

[name string] : name of the file containing the localized strings. Default: "Localizable"

→ string

Example
set f to posix file "/Applications/Preview.app/" localize "ModDate" in f -- in English, returns "Modification Date" -- in French, returns "Date de modification"

converttext v

converttext string : the string to convert

from string : the initial encoding

to string : the requested encoding

→ string : the converted string

textencodings v

textencodings

[as type] : string or integer, default: string

→ list of string : the available text encodings

unicode character v : convert unicode numbers into Unicode text

unicode character integer : or a list of integer

[encoding type] : Unicode text (UTF-16) or «class utf8»: the underlying encoding of the direct parameter. Default: Unicode text.

→ string

Example
--get unicode character 03A9: unicode character 3 * 16 * 16 + 10 * 16 + 9 -- "Ω"

unicode number v : convert an unicode string into a list of integers

unicode number string : the unicode string

[encoding type] : Unicode text (UTF-16) or «class utf8»: the encoding of the result. Default: Unicode text.

→ list of integer : the list of UTF-16 or UTF-8 unicode numbers

coerceAsUnicodeText v : coerce as Unicode text

coerceAsUnicodeText anything

[using string] : the text delimiter (required if the direct parameter is a list)

→ string

Cformat v : format a real number using a specification string like in the C function printf.

Cformat real : the number (or a list of numbers)

into string : the formatting string, [flags][width][.precision]type. Type must be into e, E, f, g, G. flags: -, +, blank, #.

latex boolean : output the scientific notation as a LaTeX string more suitable for drawings.

→ string : the formatted number

Example
Cformat pi into "%.4g" -- "3.142" Cformat 10 * pi into "%10.2f" -- " 31.42"

encode64 v : encode the direct parameter using the base64 encoding and return the string. encode64 may encode AppleScript data, text or file

encode64 [anything] : the input is an applescript value. Use the "typed" and "using" parameters to choose the suitable behavior

[from file alias] : the input is a file. "typed" and "using" are usually irrelevant

[typed boolean] : Default: true. True: include the AppleScript type within the encoded entity. False: encode as raw data. If false, you have to specify a "as" parameter when reading the data with "decode64". If the direct parameter is a complex type (list or record) this parameter is always assumed to be true

[using type] : if "typed" is false, this parameter allows you to force the type of the data to encode. For instance, it is rather awkward to force AppleScript to use a given format for strings. Thus if you need to encode a string in UTF8 format it is often necessary to add "without typed using «class utf8»" at the end of the command

[line length integer] : the maximum line length of the result: some CRLFs are inserted in the result string if this parameter is not 0. Default:0.

→ string : the encoded string

Example
set enc to encode64 {0, 1, 2} decode64 enc -- {0, 1, 2} set enc to encode64 "Hello" using «class utf8» -- "ZGxlMgAAAAB1dGY4AAAABUhlbGxv=" the base64 translation of the AppleScript string "Hello", i.e. type = typeUTF8Text + contents = Hello decode64 enc -- "Hello" set enc to encode64 "Hello" without without typed using «class utf8» -- "SGVsbG8=" the base64 translation of the UTF-8 characters of "Hello" decode64 enc as «class utf8» -- "Hello"

decode64 v : decode the base64 encoded direct parameter.

decode64 string : the encoded string

[as type] : Default: Unicode text

[typed boolean] : Default: true. If true, the "as" parameter is irrelevant; the original AppleScript type is encoded in the input. If false you have to specify the "as" parameter to get a returned value of a given type.

[to file] : put the result in a file, instead of returning a value. The parameters "as" and "typed" are irrelevant

anything

digest v : make a digest from a string, a file (raw data) or a string containing raw data encoded in base64

digest [string] : the digest operates on the UTF-8 representation of the string

[from file alias] : a file containing the raw data

[base64 string] : the base64 representation of the data to digest

[algorithm text] : "SHA1"or "MD5". Default: "MD5"

→ string : the base64 representation of the digest

Example
set s to "make a digest of this string" digest s -- "RwlYLvHKLZ/Pu3XcigF0GQ==" -- equivalent to digest base64 (encode64 s using «class utf8» without typed) -- "RwlYLvHKLZ/Pu3XcigF0GQ=="
Smile files and folders suite

GetUTI v : retrieve an Universal Type Identifier (UTI) from a file extension, a file type, or a mime type.

GetUTI [string] : the UTI

[name extension string]

[file type string]

[Mime type string]

[conforming to string]

→ string : the UTI as a record

UTIConform v : check if a given UTI conforms to an other one. Ex: "public.text" UTIConform to "public.data" returns true

UTIConform string : the UTI

to string : a candidate parent UTI

→ boolean

subscribe folder v : register a folder callback to be called each time the subscribed folder is modified (or notified).

subscribe folder alias

subroutine string : the name of the subroutine to handle asynchronously the notifications. Prototype: on mysubroutine(theAlias,param) or on mysubroutine(theAlias); "theAlias" is the direct parameter and "param" is the "userparam" parameter

[userparam anything] : a user parameter returned as the second parameter of the subroutines

→ integer : an ID to provide to the unsubscribe folder command

unsubscribe folder v : unregister a folder callback

unsubscribe folder integer : the ID returned by "subscribe folder"

notify folder v : a folder notified with 'notify folder' behaves just as if it was modified (may call a folder script and 'changed folder')

notify folder alias

navchoose url v : choose url with navigation services (without boundary effects)

navchoose url

→ string : the chosen url

Smile scripted scripting

find definition for v

find definition for string

[in alias] : (list of) file or folder, default: scripting additions folder

[as type] : default: return the definition as styled text

anything

execute v : run the contents of a window

execute reference : the window

check syntax v : check syntax of the contents of a window

check syntax reference : the window

validate v : validate the contents of a window

validate reference : the window

display v : return the direct object as a string

display anything

→ string

do script v : execute a script

do script string : the script

[as type] : wanted type for the result

anything

callhandler v : call a subroutine of the Smile's context. Example: callhandler {1,"foo"} subroutine "doit", will issue a doit(1,"foo"). Useful to dispatch subroutine calls with string variables.

callhandler list of anything : list of parameters

subroutine string : the name of the handler (only lowercase letters)

anything : the result of the handler

Smile drawings Suite

print settings n

properties

copies integer : The number of copies of a document to be printed

collating boolean : Should printed copies be collated?

starting page integer : The first page of the document to be printed

ending page integer : The last page of the document to be printed

pages across integer : Number of logical pages laid across a physical page

pages down integer : Number of logical pages laid out down a physical page

requested print time date : The time at which the desktop printer should print the document

printer features list of string

fax number string : The number to which to fax the document

target printer string : The name of the destination print queue


graphic window n [inh. window > basic object] : a window where you can draw pictures of various kinds by script, and that you can save as a PDF file or as a jpg, png or tiff file.

elements

contains graphic views, widgets; contained by application.

properties

frame list of small real : {x origin,y origin,width,height}, the page frame. Values are real numbers. Prefer pageheight and pagewidth

pageheight small real : Unit = 1/72 inch. Can be set in inches or centimeters

pagewidth small real : Unit = 1/72 inch. Can be set in inches or centimeters

margins list of small real : {x margin,y margin}, the page margins (affect the scrollbars). Values are real numbers.

background color list of small real : an alias to the fill color property.

scale small real : zoom factor. Default 1.0

resolution small real : image resolution. Default: 72dpi.

grid list of integer : a list of 2 integers, default is {1,1}. These numbers are used to provide default frames to the graphic views. The first (resp. second) number is the number of expected views horizontally (resp. vertically)

back pdf string : the PDF data for the background of the window. Can be set to a file, to some Graphic Kernel output or to raw PDF data as string.

front pdf string : the PDF data drawn after the background and the graphic views of the window. Can be set to a file, to some Graphic Kernel output or to raw PDF data as string.

title offset small real : vertical offset for view's titles

template string : name of a file in the 'SmileLab templates' folder, that will specify the default settings

movie file file specification : file path for recording

See online documentation for clarification

movie codec string : a four character code specifying the codec (e.g. "raw " for raw codec, "avc1" for H264 codec, "mp4v" for mpeg4 visual codec)

quality real : specify the quality of the compressed image when saving as an image file. It is a number between 0.0 and 1.0 (the best quality). Default 1.0

save all pages boolean

graphic view n [inh. basic object] : a virtual class, the common ancestor for a set of classes of objects that you may create in a graphic window.

elements

contained by graphic windows.

properties

frame list of real : {x origin,y origin,width,height}. Defines the rectangular region which will be erased when the graphic object is redrawn. The rectangle is relative to the origin of the graphic window. Values are real numbers

back pdf string : The PDF data for the background of the view. Can be set to a file, to some Graphic Kernel output or to raw PDF data as string.

front pdf string : The PDF data drawn after the background and the contents of the view. Can be set to a file, to some Graphic Kernel output or to raw PDF data as string.

widget n [inh. basic object] : a scriptable point marker for graphic windows and planar views.

elements

contained by graphic windows, planar views.

properties

point list of small real : {x,y}

pattern style integer : 0 none, 1 circle, 2 square, 3 diamond, 4 upwards triangle, 5 downwards triangle, 6 x-cross, 7 cross, 8 dot, 9 custom, 10 histogram

custom pattern list of small real : {x1, y1, ..., xn, yn}, coordinates of the polygon which will be used as the pattern (effective only if "pattern style" is set to 9)

pattern size small real : size of the pattern if "pattern style" is not 0

pen color list of small real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

fill color list of small real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

pen width small real

move while dragging boolean : If false, the user can't move the widget using the mouse


pick in e : event sent to the script of the graphic window (or the graphic view) when the user clicks in it (or in a widget).

pick in reference : a graphic view or a graphic window

at record : {point:{x, y} or {x, y, z} for the view3D, step:1 (mouse down), 2 (mouse dragged), 3 (mouse up), 4 (double-click), target object: the object under the mouse e.g. a surface, a widget...}

keydown e : event sent to the script of the (front) graphic window when the user hits a key

keydown reference : the graphic window

event record : {character:the character, modifiers:the modifiers}

resized e : event send to the script of the graphic window or of the views when the user resizes the object

resized reference : a graphic window or a view

makePDF v : used internally by the Graphic Kernel library to generate PDF data

makePDF string : the PDF source string as built internally by Graphic Kernel

[in anything] : write directly into this file

media box bounding rectangle

→ string : the PDF data

addPDF v : append more PDF data into an object

addPDF string : the PDF data or file

in reference : the back pdf (or front pdf) property of a graphic window or a graphic view

at anything : a point or a rect

create imagefile v : convert matrix values into 256 levels then save it as a bitmap image (PNG, JPEG, TIFF etc). You can provide a SmileLab palette to handle colors.

create imagefile matrix

in file specification : destination file. Its extension specifies the image format.

[inverted boolean] : inverse image levels. Default false.

[minimum real] : matrix values equal or greater than this value are set to 255. Default: maximum of the matrix values.

[maximum real] : matrix values equal or lower than this value are set to 0. Default: minimum of the matrix values.

[resolution integer] : image resolution. Default: 72dpi.

[color palette string] : if not specified, save as gray levels image.

→ alias

Example
set m to creatematrix "x" ncols 100 nrows 200 as matrix set f to ("" & (path to desktop) & "test.png") set x to create imagefile m in file f open x

mask imagefile v : mask an image with an image mask (if the "using" parameter is an alias) or mask a range of colors (if the "using" parameter is a list of real).

mask imagefile alias : the source image

using alias or list of real : the mask image (must be in a gray color space), or a range of colors. For instance {min_r, max_r, min_g, max_g, min_b, max_b, min_a, max_a} for an rgb image file, where each number is between 0.0 and 1.0. In this case, source image pixels whose color is in the given range are masked.

in file specification : the destination file. Its extension specifies the image format.

→ alias

print v : print a pdf file

print alias : a pdf file

[with properties print settings]

[print dialog boolean]

[duplex integer] : Only for MacOS 10.4 or later. 1: one side of sheet of paper, 2: both sides of the paper, with no tumbling, 3: both sides of the paper, tumbling on, 4: one side of the paper, tumbling on

offset list of real : (obsolete). {dx, dy} an optional offset to shift drawings in the page

count pages v

count pages alias : a pdf file

→ integer

pdf boxes v : returns the mediabox, the bleedbox, the trimbox and the artbox of a pdf page.

pdf boxes alias

[page integer] : Default:1.

→ record

insert pdf v : merge pdf files

insert pdf alias : the file containing the pages to add

[page integer] : the first page to copy. Default: 1

[thru integer] : the last page to copy. Default: 1

in alias : the destination file

[at integer] : the index of the insertion in the destination file. Default: at end

image info for v

image info for alias : the source file

→ record

extract image v

extract image alias : the source file

[index integer] : default 1. The index of the image in the source file

to alias : the destination file

[thumbnail size integer] : if present, extract image makes a thumbnail and thumbnail size specifies the maximum width and height in pixels of the thumbnail

[selected rectangle list of real] : the rectangle in pixels {x,y,width height}

[pixel unit boolean] : default true. If false, selected rectangle must be provided taking into account the resolution of the source image

[resolution small real] : default 72.0. The dpi of the destination image.

[quality real] : specify the compression. It is a number between 0.0 and 1.0 (the best quality). Default 1.0

CIfilter names v : return the list of available CoreImage filters to use with the filter image command

CIfilter names [text] : a list of filter categories. If the parameter is missing, the command returns the list of available categories

→ list of string

info for CIfilter v

info for CIfilter text : the name of the filter

[verbose boolean] : If true, provide the full description of the filter. Otherwise, return the default settings for the filter image command. Default:false.

text : the description of the filter as a propertylist.

filter image v : apply a CoreImage filter. You can test such filters with the "Image filters" dialog. Currently, this dialog is accessible from the "User scripts > More Smile commands > Misc" menu item.

filter image [alias] : the source image. Remark: some filters does not require an input image (for instance the generators); in this case only the dimensions of the direct parameter are relevant and alternately you can provide the selected rectangle parameter to define the dimensions of the output image.

[index integer] : default 1. The index of the image in the source file

to alias : the destination file

[selected rectangle list of real] : the rectangle in pixels {x,y,width height}

filter boolean : the name of the filter to apply (see the CIfilter names command)

[dictionary record] : the filter settings: a plist string containing the filter parameters (see the info for CIfilter command)

[quality real] : specify the compression. It is a number between 0.0 and 1.0 (the best quality). Default 1.0

SmileLab Suite
Graphic presentation of numerical data. Unless otherwise stated, lengths are real numbers, and the length unit is one pixel

picture view n [inh. graphic view > basic object] : a picture view only draws its PDF data.

chart view n [inh. graphic view > basic object] : a virtual class, the ancestor for plot view and planar view

elements

contains array of real.

properties

plot frame list of real : {x origin,y origin,width,height}, the rectangle enclosing the curves. Values are real numbers.

frame kind integer : 1 draw secondary axes, +2 draw ticks on secondary axes, +4 draw the grid, +8 draw ticks inside the plot frame. Default: 15.

limits list of real : {xmin,xmax,ymin,ymax}, the limit values for the x and y axis (may contain "auto"). For a plot view, "limits" contains 6 reals; the 2 last numbers correspond to the secondary (right hand side) y axis limits.

current limits list of real, r/o : {xmin,xmax,ymin,ymax}, the current limit values for the x and y axis

text font string : the name of the font

text size real

pen color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

fill color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

text color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

grid color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

grid dash list of real : {Lstart,Lstr1,Lsp1,..,Lstrn,Lspn}. Dash starts at Lstart and draws n sequences of stroke (Lstr) + space (Lsp). For instance use Lstart = Lstr1 to have the dashes start at beginning of first space.

pen width real

grid pen width real

major tick length real

minor tick length real : (enter a negative value to have the ticks point outwards)

xtick spacing real : default 0: auto spacing

ytick spacing real : default 0: auto spacing

secondary ytick spacing real : default 0: auto spacing

xsubtick number integer : the number of subticks between two ticks on the x axis. default 0: auto

ysubtick number integer : the number of subticks between two ticks on the y axis. default 0: auto

secondary ysubtick number integer : the number of subticks between two ticks on the secondary y axis. default 0: auto

log xaxis boolean : is the x axis logarithmic? Default false.

log yaxis boolean : is the y axis logarithmic? Default false.

secondary log yaxis boolean : is the secondary y axis logarithmic? Default false.

xaxis format string : formatting string using a specification string Cformat (i.e. like in the C function printf). Ex: "%g", "%.4g", "%2.2f%%".

yaxis format string : formatting string using a specification string Cformat (i.e. like in the C function printf). Ex: "%g", "%.4g", "%2.2f%%".

secondary yaxis format string : formatting string using a specification string Cformat (i.e. like in the C function printf). Ex: "%g", "%.4g", "%2.2f%%".

grid reference : use "grid" only with the "draw" verb to have the grid redraw before drawing the set of curves

xlabel string : text of label for x axis. Texts of labels support few TeX conventions. For instance "\\pi" will display the greek pi letter, "a^n" (resp. "a_n") will display n as a superscript (resp. subscript).

xTeXlabel string : text of label for x axis as a full LaTeX string. Ex: "\\Large$x$ coordinate". Requires an installation of TeX. You can choose the font size with one of the following commands: \tiny, \footnotesize, \scriptsize, \small, \normalsize, \large, \Large, \huge, \Huge

xlabel offset real : vertical offset of label for x axis

ylabel string : text of label for y axis. See the documentation for xlabel

yTeXlabel string : text of label for y axis. See the documentation for xTeXlabel

ylabel offset real : horizontal offset of label for y axis

secondary ylabel string : text of label for secondary y axis. See the documentation for xlabel

secondary yTeXlabel string : text of label for secondary y axis. See the documentation for xTeXlabel

secondary ylabel offset real : horizontal offset of label for secondary y axis

label text font string : the name of the font. If the specified font is not available, the default font is used instead.

label text size real

legend text font string

legend text size real

legend pen width real : pen width for the legend frame

legend fill color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

legend pen color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

legend text color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

xaxis labels list of string : custom labels for the x-axis that will print instead of the scales

xaxis labels positions list of real : abscissae of the custom labels in user units

xaxis scale tilt real : the tilt angle for the scales (in radians)

user transformation list of real : the affine transformation for SetUserTransformation() in order to draw in the plot coordinates

plot view n [inh. chart view > graphic view > basic object] : use the plot view to display 1-d curves. plot views are the containers for curves.

elements

contains curves.

properties

legend kind integer : 1 no curve legend, 2 legend in a frame, 3 legends on curves at the abscissa provided as the "legend abscissa" property

legend sample length real

legend height real : size of each line in the legend frame. unit: the legend text size.

legend margins record : containing 2 real numbers "top margin" (or "bottom margin") and "left margin" (or "right margin").

legend abscissa real : effective only if "legend on curve" is true

curve n [inh. basic object] : a curve may plot, either an explicit function provided as its "formula", or a set of points provided as its "xdata" and "ydata".

elements

contained by plot views.

properties

line style integer : 0 none, 1 line, 2 smooth, 3 line+filled, 4 smooth+filled. Smoothing makes more sense if the curve really represents some f(x) function.

pattern style integer : 0 none, 1 circle, 2 square, 3 diamond, 4 upwards triangle, 5 downwards triangle, 6 x-cross, 7 cross, 8 dot, 9 custom, 10 histogram

custom pattern list of real : {x1,y1,..,xn,yn}, coordinates of the polygon which will be used as the pattern (effective only is "pattern style" is set to 9)

pattern size real : size of the pattern in pixels if "pattern style" is not 0

histogram bar width real : width of the histogram bars in user units if "pattern style" is 10

pen color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

fill color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

pen width real

dash list of real : {Lstart,Lstr1,Lsp1,..,Lstrn,Lspn}. The dash pattern draws repeatedly the n sequences of stroke (Lstr) + space (Lsp). Lstart is the beginning offset in the pattern. For instance use Lstart = Lstr1 to have the dashes start at beginning of first space.

formula string : any function of the x variable, for instance "sin(x)". Check the Satimage osax dictionary about the available mathematical functions. Set the formula to the empty string to suppress it.

step real : the distance between two consecutive x values where the formula will be computed. By default "step" is 0 and SmileLab computes the formula at 100 equidistant points.

xdata array of real : the list of the x values

ydata array of real : the list of the y values

errorbar data array of real : list of positive numbers to plot error bars.

upper errorbar data array of real : list of positive numbers to plot upper error bars.

lower errorbar data array of real : list of positive numbers to plot lower error bars.

contained data list of real : Obsolete. The x and y values as a list of two lists of equal length {{x1,..,xn},{y1,..,yn}} (effective only if "formula" is set to the empty string)

secondary yaxis boolean : draw the curve relatively to the secondary y axis

antialiasing boolean : default true. Plots made of a huge numbers of points (such as Poincaré maps) may be nicer if "antialiasing" is set to false.

in legend boolean : is the curve displayed in the plot view's legend box? Default true.

TeXName string : a LaTeX string for the name of the curve in the legend box. See the documentation of the xTeXlabel of the chart view

Example
set y to runningsum (randomarray 500 range {0, 0.01}) set x to runningsum (y) set w to make new graphic window with properties {name:"window's name", pageheight:300, pagewidth:400} set v to make new plot view at w with properties {name:"Title"} set c to make new curve at v with properties {xdata:x, ydata:y}

planar view n [inh. chart view > graphic view > basic object] : use the planar view to display bitmaps, scalar fields, vector fields and contours.

elements

contains contour maps, vector plots, bitmaps, scalar maps, triangulated maps, triangulated contours, widgets.

properties

palette format string : formatting string (i.e. like in the C function printf or the Cformat command)

transformation list of real : a list {a,b,c,d,tx,ty} that defines an optional linear transformation to apply to contour maps and to scalar maps.

resolution real : in dpi. Default 72.

scalar map n [inh. basic object] : use the scalar map to visualize a 2D array of real numbers as a bitmap image.

elements

contained by planar views.

properties

xdata anything : either the list of the x values, or the full 2D array of the x values given as a matrix. If "xdata" is empty, the positive integers are used as the default x values.

ydata anything : either the list of the y values, or the full 2D array of the y values given as a matrix. If "ydata" is empty, the positive integers are used as the default y values.

data matrix : the 2D array of the z values.

limits list of real : {data min,data max}

current limits list of real, r/o : {data min,data max}, the current limit values

polar boolean : are the xdata and ydata; i.e. xdata must be interperted as a radius and ydata as an angle in radian.

pbc1 boolean : periodic boundary condition for each row (period ncols). Consider that the first and last columns are subsequent (in xdata and ydata).

pbc2 boolean : periodic boundary condition for each column (period nrows). Consider that the first and last rows are subsequent (in xdata and ydata).

color palette list of real : the name of the color palette or a list of 4*n real numbers, {red0, green0, blue0, alpha0,...}, n is at most 256. Default is a rainbow palette.

inverted boolean : inverts the color palette

draw palette boolean

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

Example
set x to runningsum (randomarray 100) set y to runningsum (randomarray 200) set m to creatematrix "x" ncols 100 nrows 200 range {1, 2} as matrix set w to make new graphic window with properties {name:"window's name", pageheight:300, pagewidth:400} set v to make new planar view at w with properties {name:"Title"} set c to make new scalar map at v with properties {xdata:x, ydata:y, data:m}

contour map n [inh. basic object] : use the contour to display contours of a z(x,y) surface

elements

contained by planar views.

properties

xdata anything : either the list of the x values, or the full 2D array of the x values given as a matrix. If "xdata" is empty, the positive integers are used as the default x values.

ydata anything : either the list of the y values, or the full 2D array of the y values given as a matrix. If "ydata" is empty, the positive integers are used as the default y values.

data matrix : the 2D array of the z values.

level number integer : the number of contours

levels list of real : an alternate way to specify the contour levels

limits list of real : {data min,data max}

current limits list of real, r/o : {data min,data max}, the current limit values

pbc1 boolean : periodic boundary condition for each row (period ncols). Consider that the first and last columns are subsequent (in xdata and ydata).

pbc2 boolean : periodic boundary condition for each column (period nrows). Consider that the first and last rows are subsequent (in xdata and ydata).

color palette list of real : the name of the color palette or a list of 4*n real numbers, {red0, green0, blue0, alpha0,...}, n is at most 256. Default is a rainbow palette.

dash list of real : a list of dashes, i.e. a list of {Lstart,Lstr1,Lsp1,..,Lstrn,Lspn}. See "curve" for explanation.

inverted boolean : inverts the color palette

draw palette boolean

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

Example
set n to 100 set x to creatematrix "x" ncols n nrows n range {-10, 10} set y to creatematrix "y" ncols n nrows n range {-10, 10} set z to evalformula "x^2+0.01*y^4+0.05*(x+y)^3" with {x:x, y:y} set m to {class:matrix, ncols:n, nrows:n, array of real:z} set w to make new graphic window with properties {name:"window's name", pageheight:300, pagewidth:400} set v to make new planar view at w with properties {name:"Title"} set c to make new contour map at v with properties {xdata:ArrayToMatrix(x, n, n), ydata:ArrayToMatrix(y, n, n), data:m, level number:25}

vector plot n [inh. basic object] : display a vector field

elements

contained by planar views.

properties

pen color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

arrow def list of real : {overallLength,overallWidth,smallLength}, defines the shape of the arrow

arrow style integer : 0 no arrow, 1 fill arrow, 2 stroke arrow

vector scaling real : vxdata and vydata are mutiplied by "vector scaling" before plot. vector scaling is the conversion factor between the window coordinates (pixels) and the user data contained in vxdata and vydata

use view scaling boolean : if true the "vector scaling" acts with respect to the planar view coordinates, thus the orientation of the arrows depend on the limits of the planar view (and on the zoom). Use it to display a velocity field. Default: true.

xdata array of real : the x values

ydata array of real : the y values

vxdata array of real : the x-coordinates of the vector field. If you provide a matrix, provide matrices, arrays of real, or nothing for xdata and ydata.

vydata array of real : the y-coordinates of the vector field. If you provide a matrix, provide matrices, arrays of real, or nothing for xdata and ydata.

Example
set n to 20 set x to creatematrix "x" ncols n nrows n range {-10, 10} set y to creatematrix "y" ncols n nrows n range {-10, 10} set {vx, vy} to evalformula {"-sin(y)", "cos(x)"} with {x:x, y:y} set w to make new graphic window with properties {name:"window's name", pageheight:300, pagewidth:400} set v to make new planar view at w with properties {name:"Title"} set c to make new vector plot at v with properties {xdata:ArrayToMatrix(x, n, n), ydata:ArrayToMatrix(y, n, n), vxdata:vx, vydata:vy}

triangulated map n [inh. basic object] : use the interpolated map to visualize a scalar field given by a list of points and the corresponding list of values.

elements

contained by planar views.

properties

vertex list list of real : a list of two arrays of real {{x1,...xn}, {y1,...yn}}. You can also provide an array of real containing {x1,y1,..xn,yn}.

data list of real : the array of the values. Its size must be the exact number of points specified by vertex list.

limits list of real : {colordata min,colordata max}, the list items can be real values or the string "auto".

current limits list of real, r/o : {colordata min,colordata max}, the current limit values

max triangle size real : remove triangles whose maximum length is larger than max triangle size. Default: 0 (no filtering)

drawmode integer : 0: draw nothing, 1: draw fill, 2: draw lines, 3: draw lines and filled. Default: 1.

color palette string : the name of the color palette or a list of 4*nc real numbers, {red0, green0, blue0, alpha0,...}, nc is at most 256. Used to render colordata. Default is a rainbow palette.

inverted boolean : inverts the color palette

draw palette boolean

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

pen width small real : line width. Default: 1.

pen color list of real : {red=0..1,green,blue,alpha=0..1}, the color of lines if drawmode is 3. Defalut: black.

pattern style integer : the style used to mark the vertex list. 0 none, 1 circle, 2 square, 3 diamond, 4 upwards triangle, 5 downwards triangle, 6 x-cross, 7 cross. Default: 0

pattern size real : size of the pattern in pixels if "pattern style" is not 0

marker color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

marker fill color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

Example
set n to 50 set x to randomarray n range {0, 1} set y to randomarray n range {0, 1} set z to evalformula "100*(x*x+y*y)" with {x:x, y:y} set w to make new graphic window with properties {name:"Triangulated map", never save:true} set v to make new planar view at w set c to make new triangulated map at v with properties {vertex list:{x, y}, data:z, drawmode:1}

triangulated contour n [inh. basic object] : use the interpolated contour to visualize a scalar field given by a list of points and the corresponding list of values.

elements

contained by planar views.

properties

vertex list list of real : a list of two arrays of real {{x1,...xn}, {y1,...yn}}. You can also provide an array of real containing {x1,y1,..xn,yn}.

data list of real : the array of the values. Its size must be the exact number of points specified by vertex list.

level number integer : the number of contours

levels list of real : an alternate way to specify the contour levels

limits list of real : {colordata min,colordata max}, the list items can be real values or the string "auto".

current limits list of real, r/o : {colordata min,colordata max}, the current limit values

color palette string : the name of the color palette or a list of 4*nc real numbers, {red0, green0, blue0, alpha0,...}, nc is at most 256. Used to render colordata. Default is a rainbow palette.

inverted boolean : inverts the color palette

dash list of real : a list of dashes, i.e. a list of {Lstart,Lstr1,Lsp1,..,Lstrn,Lspn}. See "curve" for explanation.

draw palette boolean

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

pen width small real : line width. Default: 1.

pattern style integer : the style used to mark the vertex list. 0 none, 1 circle, 2 square, 3 diamond, 4 upwards triangle, 5 downwards triangle, 6 x-cross, 7 cross. Default: 0

pattern size real : size of the pattern in pixels if "pattern style" is not 0

marker color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

marker fill color list of real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing

Example
set n to 50 set x to randomarray n range {0, 10} set y to randomarray n range {0, 10} set z to evalformula "100*(x*sin(x)+y*y*cos(y))" with {x:x, y:y} set w to make new graphic window with properties {name:"Triangulated map", never save:true} set v to make new planar view at w set c to make new triangulated contour at v with properties {vertex list:{x, y}, data:z, drawmode:1, level number:30, color palette:"GrayInv"}

bitmap n [inh. basic object] : use the bitmap to visualize a 2D array of real numbers as a bitmap image.

elements

contained by planar views.

properties

data matrix : the 2D array of the z values.

limits list of real : {data min,data max}

color palette list of real : the name of the color palette or a list of 4*n real numbers, {red0, green0, blue0, alpha0,...}, n is at most 256.

inverted boolean : inverts the color palette

draw palette boolean

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

view3D n [inh. graphic view > basic object] : use the plot3D to display a realistic rendering of a surface. SmileLab implements an orthographic parallel viewing.

elements

contains surfaces, GLObjects, GLUObjects, GLNames.

properties

plot frame list of real : {x origin,y origin,width,height}, the rectangle enclosing the 3D graphics. Values are real numbers.

limits list of real : {xmin,xmax,ymin,ymax,zmin,zmax}, the limit values for the x, y and z axis

current limits list of real, r/o : {xmin,xmax,ymin,ymax,zmin,zmax}, the current limit values for the x, y and z axis

eye position list of real : {x,y,z,ux,uy,uz}, in the original OpenGL space coordinates. The eye position does not undergo the model rotation. Thus by default enter {y,z,x,uy,uz,ux}.

light position list of real : {x,y,z,w} or {x,y,z}, in OpenGL projective space coordinates. The light position does not undergo the model rotation. Thus by default enter {y,z,x}.

projection list of real : {left,right,bottom,top,near,far}, defines the cube which is used as the orthographic parallel viewing volume to perform the 3D view (in the OpenGL framework, "projection" is glOrtho)

rotation list of real : {angle,vx,vy,vz}, defines an optional rotation of the model (in the OpenGL framework, "rotation" is glRotatef). angle is in degrees (use with caution). default: {-120,1,1,1}

drawaxes boolean

xlabel string : text of label for x axis. See the documentation for xlabel in chart view

xTeXlabel string : text of label for y axis. See the documentation for xTeXlabel in chart view

xlabel offset real : vertical offset of label for x and y axis

ylabel string : text of label for y axis. See the documentation for xlabel

yTeXlabel string : text of label for y axis. See the documentation for xTeXlabel in chart view

fill color list of small real : {red=0..1,green,blue,alpha=0..1}, alpha = 1 = opaque drawing. View's background color.

diffused color list of real : {red=0..1,green,blue,alpha=0..1}. Light property. Default: {0.5, 0.5, 0.5, 1.0}.

ambient color list of real : {red=0..1,green,blue,alpha=0..1}. Light property. Default: {0.2, 0.2, 0.2, 1.0 }.

specular color list of real : {red=0..1,green,blue,alpha=0..1}. Light property. Default: { 1.0, 1.0, 1.0, 1.0 }.

resolution real : in dpi. Default 72.

surface n [inh. basic object] : use the surface object to visualize either a surface or/and a color field on a surface.

elements

contained by view3Ds.

properties

xdata anything : either the list of the x values, or the full 2D array of the x values given as a matrix. If "xdata" is empty, the positive integers are used as the default x values.

ydata anything : either the list of the y values, or the full 2D array of the y values given as a matrix. If "ydata" is empty, the positive integers are used as the default y values.

zdata matrix : the 2D array of the z values.

colordata matrix : optional,the 2D array of the color values (specify the diffused and ambient colors).

limits list of real : {colordata min,colordata max}, the list items can be real values or the string "auto"

pbc1 boolean : periodic boundary condition for each row (period ncols). Consider that the first and last columns are subsequent (in xdata, ydata and zdata).

pbc2 boolean : periodic boundary condition for each column (period nrows). Consider that the first and last rows are subsequent (in xdata, ydata and zdata).

orientation boolean : surface orientation. Default is true. SmileLab renders the outer/upper side of the surface as a shining surface, and its inner/down side as a dull surface. Depending on how the surface is parametrized, you may want to invert the default orientation.

drawmode integer : 0: draw nothing, 1: draw fill, 2: draw lines, 3: draw lines and filled. Default: 1.

draw palette boolean

usecolordata boolean : If false, use the 'diffused' and 'ambient' color properties for the whole surface. Default: true.

color palette list of real : the name of the color palette or a list of 4*n real numbers, {red0, green0, blue0, alpha0,...}, n is at most 256.

specular color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {1.0, 1.0, 1.0, 1.0}.

emission color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.0, 0.0, 0.0, 1.0}.

ambient color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property, used only if usecolordata is false. Default: {0.2, 0.2, 0.2, 1.0}.

diffused color list of real : {red=0..1,green,blue,alpha=0..1}. Material property, used only if usecolordata is false. Default: {0.5, 0.5, 0.5, 1.0}.

specular pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

emission pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

ambient pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property, used only if usecolordata is false. Default: {0.0, 0.0, 0.0, 1.0}.

diffused pen color list of real : {red=0..1,green,blue,alpha=0..1}. Line property, used only if usecolordata is false. Default: {0.0, 0.0, 0.0, 1.0}.

shininess small real : a number between 0.0 and 128.0. Default: 25.0.

legend margins record : {legend kind:k, left margin:l, right margin:r, top margin:t, bottom margin:b} where k is an integer specifying from which edge of the plot frame of the container view the margins are applied (1:from right, 2:from top, 3:from left, 4:from bottom}. Only three of the given margin values are effective, for instance if k is 1 (from right), 'right margin' is not used.

Example
set n to 100 set x to creatematrix "x" ncols n nrows n range {0, 1} set y to creatematrix "y" ncols n nrows n range {0, 1} set z to evalformula "(x+y)/(0.01+x*x+y*y)" with {x:x, y:y} set z to {class:matrix, ncols:n, nrows:n, array of real:z} set xx to createarray n range {0, 1} set yy to createarray n range {0, 1} set w to make new graphic window with properties {name:"Triangulated map", never save:true} set v to make new view3D at w with properties {xlabel:"x", ylabel:"y", eye position:{1.5, 1.2, -1.5, -0.35, 0.85, 0.4}} set c to make new surface at v with properties {xdata:xx, ydata:yy, zdata:z}

GLObject n [inh. basic object]

elements

contained by view3Ds.

properties

kind curve3D | triangle strip | triangle set | quad strip | quad set | polygon | tetrahedron | parallelepiped : the GLObject kind. Affect the meaning of contained data

contained data list of real : a list {x1,y1,z1,..xn,yn,zn}

drawmode integer : 0: draw nothing, 1: draw fill, 2: draw lines, 3: draw lines and filled. Default: 1.

pen width small real : size of wires. Affected by the view's resolution. Default: 1.

diffused color list of real : {red=0..1,green,blue,alpha=0..1}. Material property. Default: {0.5, 0.5, 0.5, 1.0}.

specular color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.0, 0.0, 0.0, 1.0}.

ambient color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.2, 0.2, 0.2, 1.0}.

emission color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.0, 0.0, 0.0, 1.0}.

diffused pen color list of real : {red=0..1,green,blue,alpha=0..1}. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

specular pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

ambient pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

emission pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

shininess small real : a number between 0.0 and 128.0. Default: 25.0.

fill color list of real : {red=0..1,green,blue,alpha=0..1}, a shortcut to set both the diffused and the ambient color.

pen color list of real : {red=0..1,green,blue,alpha=0..1}, a shortcut to set both the diffused and the ambient pen color.

colordata list of real : optional,the array of the color values (specify the diffused and ambient colors). Its size must be the exact number of points specified by 'contained data'.

color palette string : the name of the color palette or a list of 4*nc real numbers, {red0, green0, blue0, alpha0,...}, nc is at most 256. Used by colordata. Default is a rainbow palette.

limits list of real : {colordata min,colordata max}, the list items can be real values or the string "auto"

transformation list of real : a list of 16 reals: an OpenGL transformation matrix.

Discussion
contained data is a list of real numbers corresponding to 3D points' coordinates: {x1,y1,z1,..xn,yn,zn}.
The meaning of contained data depends on the kind of the GLObject.
For curve3D and polygon, this list defines the successive points of the GLObject.
For triangle set (resp. quad set), this list must contain 3*n points (resp. 4*n points) to define n triangles (resp. n quads).
For triangle strip, this list must contain n+2 points to define n triangles: three consecutive points define one triangle.
For quad strip, this list must contain 2*n+2 points to define n quads: four consecutive points define one quad.
For tetrahedron (resp. parallelepiped), this list must contain 4*n points to define n tetrahedra (resp. n parallelepipeds). For each item the first point is the origin, and the three following points are interpreted as the edges' vectors.

GLUObject n [inh. basic object]

elements

contained by view3Ds.

properties

kind GLUSphere | GLUCylinder | GLUDisk | GLUCube

point list of real : {x,y,z} the origin of the object. The center for spheres and disks. The center of the base for cylinders.

radius small real : the radius for spheres, the base radius for cylinders, the inner radius for disks (rings really), the edges' length for cubes

radius2 small real : top radius for cylinders (cones really), outer radius for disks

direction list of real : {ux,uy,uz}, axis for cylinder or normal for disks

height small real : the length for cylinders

transformation list of real : a list of 16 reals: an OpenGL transformation matrix.

drawmode integer : 0: draw nothing, 1: fill faces, 2: draw lines, 3: draw and fill. Default: 1.

pen width small real : size of wires. Affected by the view's resolution. Default:1.

diffused color list of real : {red=0..1,green,blue,alpha=0..1}. Material property. Default: {0.5, 0.5, 0.5, 1.0}.

specular color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {1.0, 1.0, 1.0, 1.0}.

ambient color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.2, 0.2, 0.2, 1.0}.

emission color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Material property. Default: {0.0, 0.0, 0.0, 1.0}.

diffused pen color list of real : {red=0..1,green,blue,alpha=0..1}. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

specular pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

ambient pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

emission pen color list of real : {red=0..1,green,blue,alpha=0..1}. alpha is ineffective. Line property. Default: {0.0, 0.0, 0.0, 1.0}.

shininess small real : a number between 0.0 and 128.0. Default: 25.0.

fill color list of real : {red=0..1,green,blue,alpha=0..1}, a shortcut to set both the diffused and the ambient color.

pen color list of real : {red=0..1,green,blue,alpha=0..1}, a shortcut to set both the diffused and the ambient pen color.

slices integer

stacks integer

GLName n [inh. basic object] : display its name property at the specified coordinates

elements

contained by view3Ds.

properties

point list of small real : {x,y,z}


convert coordinates v : turn user coordinates (as defined in a chart view) into pixels

convert coordinates list of real : the point in user coordinates (as shown by the axes)

in chart view : the chart view in which the translation is made

→ list of real : the point in pixels, relative to the chart view's system of coordinates

convert secondary coordinates v : turn user coordinates using secondary axis (as defined in a chart view) into pixels

convert secondary coordinates list of real : the point in user coordinates (as shown by the axes)

in chart view : the chart view in which the translation is made

→ list of real : the point in pixels, relative to the chart view's system of coordinates

triangulate v

triangulate array of real : list of 2D points x1,y1,x2,y2,etc. Or a list of two array of real {x values, y values}

[as type] : "array of real" or "list of integer". Default: "array of real"

[syncing list of array of real] : an optional list of additional parameters to be synchronized with the list of triangles.

anything : depends on the "as": a list of arrays of real starting with x and y arrays. Or a list of integers: a set of indices in the list of the 2D points. Each group of 3 consecutive values defines a triangle.

HSV2RGB v : color translation

HSV2RGB list of real : {hue=0..1,saturation,value}

→ list of real : {red=0..1,green,blue}

choose CGcolor v : choose a color with the color picker

choose CGcolor [list of real] : the initial value. Depend on the value of the "color space" parameter. {red=0..1,green,blue} for "rgb", {cyan=0..1, magenta, yellow, black} for "cmyk", {hue=0..1,saturation,value} for "hsv", an html color string ("#rrggbb" or "rgb(r,g,b)") for "html". Default: the default value of the color picker

color space string : "rgb" or "cmyk" or "hsv" or "html": the color space of the result. Default: "rgb"

→ list of real : or a string, according to the the "color space" parameter.

register icon v : register an icns file as icon reference

register icon alias : the .icns file

as string : the icon ID: a 4 letters string. This ID may be used with some dialog items

add movieframe v

add movieframe reference : a reference to a graphic window or a graphic view

[duration real] : the duration in seconds, default 0.1

play v : play a movie

pause v : pause a movie

pause movie window

Smile over IP
requires a paid license - demo license available at satimage-software.com

install server port v : install and start listening to the port specified by the direct parameter. Any other Smile on the network can now call this port with "call remote port"

install server port integer : the port number

subroutine string : name of the AppleScript subroutine handling incoming requests. Prototype: on myServerRoutine(theQuery,theTaskID); "theQuery" is the "with data" parameter of the caller, "theTaskID" is an ID allowing to asynchronously process the requests.

[for list of string] : restricted list of IP addresses

call remote port v : call a server port previously installed with "install server port". This port may belong to Smile or to another Smile process on the same machine or anywhere on the network

call remote port integer : the remote port number

at string : a dotted Internet address or a host name

with data anything : the data to send

[subroutine string] : the name of the subroutine to handle asynchronously the response. Prototype: on mysubroutine(theAnswer,param); "theAnswer" is the result of "myServerRoutine" on the server side. If this parameter is missing, "call remote port" does not wait for a response. If this parameter is "", "call remote port" is synchronous and returns the response.

[error subroutine string] : the name of the subroutine to handle asynchronously the errors. If this parameter is missing, "call remote port" send the data synchronously. Prototype: on errorsubroutine(err,param), at runtime err is the error number and param is the value of "userparam"

[userparam anything] : a user parameter returned as the second parameter of the subroutines

anything : only if "subroutine" parameter is ""

resume server task v : the subroutine of a server port may throw an error number -1718 (ReplyNotArrived) to handle asynchronously the requests. In this case, the processing is suspended and will resume on a "resume server task" call.

resume server task integer : the task ID, received as the second parameter of the subroutine of the server port

with data string : data to send

remove server port v : close and free the server port

remove server port integer : the port number

register server port v : associate a port number of the machine to a public service type

register server port integer : the port number

service string : the service type. A valid Bonjour identifier i.e. "_myServiceKind._tcp" or "_myServiceKind._udp". If this port corresponds to a port open with "install server port" the suffix must be "._tcp"

[name string] : human-readable name of the service

[domain string] : default "local."

unregister server port v : unregister a port registered with "register server port"

unregister server port integer : the port number

list registered ports v : seek over the network to find remote ports handling a given service type

list registered ports string : the service type

[domain string] : default "local."

[timeout real] : default : 1 second

→ list of record : the found services

Smile IO devices

RSSetting n : Options for RS232. Use "man termios" for documentation.

properties

bauds integer

databits integer : data bits count (5, 6, 7 or 8)

stopbits integer : 1: send one stop bit, 2: send two stop bits

parity integer : 0: disabled, 1: enabled, 2: odd parity

flowcontrol integer : a value between 0 and 31. bit 1: CCTS_OFLOW, bit 2: CRTS_IFLOW, bit 3: CDTR_IFLOW, bit 4: CDSR_OFLOW, bit 5 : CCAR_OFLOW.

ICANON integer : 0 or 1: canonicalize input lines


IO device n [inh. basic object] : I/O peripheral

elements

contained by application.

Delcom USB Board n [inh. IO device > basic object] : (www.delcom-eng.com) the IO device for driving the Digital I/O USB Delcom board. Includes two ports of 8 bits each.

elements

contains digital ports.

properties

slot integer : index of the USB Delcom board, used to identify the device if several are present, default 1

Example
set the_board to make new Delcom USB Board --write data set contained data of digital port 2 of the_board to 128 set contained data of bit 8 of digital port 2 of the_board to 1 --read data get contained data of digital port 2 of the_board -- 128 get contained data of bit 8 of digital port 2 of the_board -- 1

digital port n : I/O digital port

elements

contains bits; contained by Delcom USB Boards.

properties

contained data integer : a value between 0 and 255

bit n : I/O bit

elements

contained by digital ports.

properties

contained data integer : 0 or 1

Delcom USB Display n [inh. IO device > basic object] : (www.delcom-eng.com) the IO device for numeric display on seven segments LED digits

properties

slot integer : index of the USB Delcom display, used to identify the device if several are present, default 1

active boolean : true by default. Write only

contained data list of integer : either a string or a list of 1 up to 6 integers in the 0-255 range (in this case the integers code for the segments of a digit: each bit corresponds to one digit). Write only

flash rate integer : unit: 10ms. Write only

buzzer record : {active: true/false, «class Freq»:frequency value (unit: 256 µs), «class Buz0»: cycles repeat value (except 0: no off time, 255: infinite repeat), «class Buz1»: duty cycle's on time, «class Buz2»: duty cycle's off time}. Write only

RS232 n [inh. IO device > basic object] : RS232 device

properties

configname string : UNIX path to the serial port (as provided in the serial ports Smile's property)

RSOptions RSSetting

enabled boolean

contained data string : data to send or data received

Example
--get ports info serial ports -- {{9, "/dev/cu.modem", "modem"}, {9, "/dev/cu.USA28X21P1.1", "USA28X21P1.1"}, {9, "/dev/cu.USA28X21P2.2", "USA28X21P2.2"}, {10, "en0", ""}, {10, "en1", ""}} set the_config_name to "/dev/cu.USA28X21P1.1" set the_RS to make new RS232 with properties {configname: the_config_name} set RSOptions of the_RS to {bauds:9600, databits:8, stopbits:1, parity:0} set enabled of the_RS to true --read incoming data try set the_input to contained data of the_RS on error -- no input available end try -send data set contained data of the_RS to "HELLO"

Web Suite

web window n [inh. window > basic object]

elements

contained by application.

properties

current url alias, r/o

contained data string

history list of string, r/o


callJavaScript v : execute a JavaScript script in a web window

callJavaScript reference : a web window

script string : the JavaScript source code

anything : the result of the script

callJavaScriptFunction v : invoke a JavaScript function in a web window

callJavaScriptFunction reference : a web window

parameters list of anything : list of the parameters

subroutine string : the name of the JavaScript function

anything : the result of the function

reloadURL v

reloadURL reference : a web window

take screenshot v : save a screenshot of the contents of a web window in an image file

take screenshot

of reference : a web window

in alias : the destination file

parseFormURL v : translate an urlencoded form into a plist dictionary

parseFormURL string : the URL

[as type] : as CFRef return result as a plist

→ string : xml data or CFRef

URLRequest v : send an url request. The body may be a dictionary like in a form request or raw data

URLRequest

[POST boolean] : Default true. Can also be a string. The method of the request: "POST "or "GET"

at string : the http URL

[raw body string] : the raw body of the request that will be sent as UTF8

[body record] : a dictionary like in a form request. The dictionary may be provided as a record or a propertylist containing a dict

[header string] : the header of the request: a record or a propertylist containing a dict. Ex :{|Content-Type|:"application/x-www-form-urlencoded"} or {|Content-Type|:"text/xml"}

send boolean : default: true. If false URLRequest returns the serialized message

remote header boolean : default: false. If true URLRequest returns a list of two strings, the second one is the HTTP header of response

→ string

Example
If you want to perform a GET request, you don't need to use the body or raw bodyparameters:
set r to URLRequest at theRequest POST "GET"
If you want to perform a POST request to simulate a http form, you have to specify the Content-Type to "application/x-www-form-urlencoded" in the header parameter:
set r to URLRequest at theURL header {|Content-Type|:"application/x-www-form-urlencoded"} body {|param1|:"value1", |param2|:"value2"} POST "POST"
The following line is equivalent to the preceding example but use the raw body parameter:
set r to URLRequest at theURL header {|Content-Type|:"application/x-www-form-urlencoded"} raw body "param1=value1&param2=value2" POST "POST"
You can also perform a text/xml request using the "raw body" parameter:
set s to "<?xml version=\"1.0\" ?> <test client=\"theclient\" method=\"themethod\" objectid=\"123\" sessioncode=\"456\"><p>this is a test</p></test>" set r to URLRequest at theURL header {|Content-Type|:"text/xml"} raw body s POST "POST"

pageloaded e : event sent to the script of a web window when its load is complete. This is the first time to call safely a javascript in a new web window (or a window modified with reloadURL or set contained data or set path name).

pageloaded reference : the web window