Suites: Helix Design Suite, Helix Data Suite, Required Suite, Standard Suite, AppleScript Types

AppleScript Types

AppleScript TypesBuilt-in AppleScript value types.

Description

This information, about the native built-in AppleScript datatypes, is not part of the dictionary you are viewing; a dictionary does not need to define these types, because they are built in to AppleScript! Rather, it has been provided, as a public service, by Script Debugger 6.0.

Classes

Alias

alias (noun), pl aliasesAn alias to a file or a folder on disk.
«class alis»

Description

An alias object is very much like a file object. You can form an alias specifier in just the same way as you form a file specifier, and an alias object can often be used in the same places where a file object would be used. But there are some important differences:

  • The item on disk that an alias represents must exist when the specifier is encountered at runtime. Thus an alias cannot be used to create a file or folder.
  • An alias value can be assigned directly to a variable.
  • An alias can continue pointing to an item on disk even if the item is moved or renamed.

Properties

Property
Access
Type
Description
POSIX path get text The POSIX path of the file.

Where Used

The alias class is used in the following ways:

direct parameter to the open

file property of the collection

Date

date (noun) , pl dates A date-time value.

Description

A date is a date-time, stored internally as a number of seconds since some fixed initial reference date. A date can be mutated in place, and is one of the classes for which set and copy behave differently.

A literal date is an object string specifier. In constructing a date, you may use any string value that can be interpreted as a date, a time, or a date-time. AppleScript supplies missing values such as today’s date (if you give only a time) or midnight (if you give only a date). To form a date object for the current date-time, use the current date scripting addition command.

Properties

Property
Access
Type
Description
date string get text The date portion of a date, as text.
day get integer The day of the month of a date.
month get month The month of a date. A constant (not a string or a number); however, this constant can be coerced to a string or a number, and can be set using a number.
short date string get text The date portion of a date, as text (in a more abbreviated format than the date string).
time get integer The number of seconds since midnight of a date-time’s day.
time string get text The time portion of a date, as text.
weekday get weekday The day of a week of a date. A constant (not a string or number); however, this constant can be coerced to a string or a number.
year get integer The year of a date.

Where Used

The date class is used in the following ways:

creation date property of the helix icon

modification date property of the helix icon

quick query value property of the quick query expression

File

file (noun) , pl files [synonyms: file specification ] A reference to a file or a folder on disk.

Description

A file object is a reference to a file or folder on disk. To construct one, use an object string specifier, the word file followed by a pathname string value:

file "MyDisk:Users:myself:"

If you try to assign a file object specifier to a variable, or return it as a value, you’ll get a runtime error. Instead, you must generate a reference to the file object, like this:

set x to a reference to file "MyDisk:Users:myself:"

You can also construct, and sometimes applications or scripting addition commands (such as choose file name ) will return, a file specified by its POSIX path:

POSIX file "/Users/myself/"

Such a specifier is actually of a different class, «class furl» (a file URL). This class can be difficult to distinguish from the basic file object type, but it is in fact different, and it can be assigned to a variable.

At runtime, when a file specifier is handed to some command, either the item must exist, or, if the command proposes to create it, everything in the path must exist except for the last element, the name of the item you’re about to create. Thus a file specifer can be used to create a file or folder; an alias can’t be used to do that, and this is a major difference between the two types.

Properties

Property
Access
Type
Description
POSIX path get text The POSIX path of the file.

Where Used

The file class is used in the following ways:

direct parameter to the print

Month

month (noun) , pl months A calendar month.

Where Used

The month class is used in the following ways:

month property of the date

Weekday

weekday (noun) , pl weekdays A weekday.

Where Used

The weekday class is used in the following ways:

weekday property of the date

Types

Anything

anything (type) [synonyms: any ] Anything.

Description

The any datatype is used as a wildcard type in a dictionary, usually because the creators of the dictionary have found it impractical to list explicitly the actual possible types of a value. It isn’t used in AppleScript programming.

Where Used

The anything type is used in the following ways:

direct parameter to the exists

result of get

result of utilize

contents property of the selection-object

rest property of the list

reverse property of the list

to parameter of the set

with contents parameter of the make

Boolean

boolean (type) A true or false value.

Description

A boolean is a datatype consisting of exactly two possible values, true and false, and is typically used wherever this kind of binary value possibility is appropriate. It results from comparisons, and is used in conditions. The integers 1 and 0 can be coerced to a boolean, and vice versa. The strings "true" and "false" can be coerced to a boolean, and vice versa.

class of true -- boolean
class of (1 < 2) -- boolean

Where Used

The boolean type is used in the following ways:

result of exists

direct parameter to the allow incoming connections

abacus query lock property of the view

active quick query property of the view

align to grid property of the template

allow click property of the data rectangle

allow edit property of the data rectangle

allow print property of the styled rectangle

allow query property of the data rectangle

allow tab property of the data rectangle

allow typing property of the dynamic popup

allow typing property of the static popup

allow variable width property of the dynamic popup

allow variable width property of the static popup

also use query property of the quick query expression

autoclose linked form property of the repeat rectangle

background property of the label rectangle

bold face property of the font style

check structure on open property of the application

check structure on save property of the application

closeable property of the helix icon

cold form property of the helix icon

collating property of the print settings

commas property of the number format

commas property of the fixed point format

common calculation property of the abacus

currency mark property of the number format

currency mark property of the fixed point format

default button property of the command rectangle

default values highlighted property of the view

delete host record property of the view

deletes records property of the subform linkage

deleting data parameter of the delete

design mode available property of the user

discarding unentered data parameter of the quit

discarding unentered data parameter of the close collection

display message property of the sequence

display order property of the relation

displaying progress parameter of the check structure

enable horizontal scrollbar property of the data rectangle

enable vertical scrollbar property of the data rectangle

enabled property of the autosave parameters

exact match required parameter of the get index for color

fit to page property of the view

fixing errors parameter of the check structure

framed property of the template rectangle

frontmost property of the application

graph paper property of the template

has default button property of the template

has document property of the template

has large picture property of the label rectangle

has large picture property of the command rectangle

has local label property of the command rectangle

has password property of the user

has picture property of the label rectangle

has picture property of the command rectangle

has repeat property of the template

has status box property of the helix icon

hide disabled button property of the command rectangle

hide labels property of the flag format

horizontally scrollable property of the helix icon

ignoring locks parameter of the delete

include icon names property of the view

include outer data property of the view

include seconds property of the date format

includes document property of the template

includes form tile property of the abacus

includes form time tile property of the abacus

includes inert field property of the abacus

includes lookup tile property of the abacus

includes post time tile property of the abacus

includes statistics tile property of the abacus

includes today tile property of the abacus

includes unique tile property of the abacus

includes use from tile property of the abacus

includes user name tile property of the abacus

inert property of the field

invalid fields highlighted property of the view

invisible property of the helix icon

is valid property of the index

italic face property of the font style

keep value property of the data rectangle

keep versions property of the field

keyword property of the field

leading zero property of the date format

locked property of the helix icon

logging parameter of the save

modified property of the collection

modifying allowed parameter of the login

moving forward property of the view

notify on change property of the view

open window property of the menu item

outline face property of the font style

page numbering property of the label rectangle

percent sign property of the number format

post every property of the post parameters

preview property of the template

print dialog parameter of the print

quick form property of the template

quick query lock property of the view

quick query value property of the quick query expression

record ids parameter of the utilize

require custom labels property of the flag format

resizeable property of the helix icon

returning list parameter of the check structure

ruler property of the template

scale picture property of the styled rectangle

scientific notation property of the number format

selectable property of the repeat rectangle

shadow face property of the font style

show page boundaries property of the helix icon

showing record property of the view

spell check property of the data rectangle

stopping for errors parameter of the check structure

stopping on error parameter of the check rectangle overlap

strip field delimiters property of the view

strip record delimiters property of the view

strip return characters property of the view

summary calculation property of the abacus

transparency property of the command rectangle

underline face property of the font style

use calculated label property of the command rectangle

use custom format property of the data rectangle

use specified document path property of the view

user mode parameter of the open

user mode property of the collection

user mode property of the user

user name security property of the collection

vertically scrollable property of the helix icon

visible on first page property of the template rectangle

visible on interior page property of the template rectangle

visible on last page property of the template rectangle

word wrap property of the data rectangle

writing log parameter of the check structure

zoomable property of the helix icon

Integer

integer (type) An integer value.

Description

The integer datatype is one of the two basic number types; the other is real. An integer is a whole number, without a decimal point. It must lie between 536870911 and –536870912 inclusive.

Where Used

The integer type is used in the following ways:

result of count

result of version

result of check structure

direct parameter to the remove

after parameter of the add

answer index property of the abacus

apple event maximum add property of the application

apple event maximum delete property of the application

apple event maximum get property of the application

at parameter of the make

at parameter of the add

autosave idle delay property of the autosave parameters

autosave interval property of the autosave parameters

autosave start time property of the autosave parameters

backward parameter of the move

client idle timeout property of the collection

client idle timeout property of the user

copies property of the print settings

current apple event processes property of the application

current users property of the application

current users property of the collection

datakey property of the relation

datakey property of the field

day property of the date

diagnostic data property of the structure check result

dividers property of the collection

dividers property of the relation

ending page property of the print settings

error code property of the structure check result

forward parameter of the move

found id property of the structure check result

found type property of the structure check result

frame width property of the group rectangle

horizontal spacing property of the template

id property of the structure check result

id property of the window

id property of the object

index ID property of the index

index object property of the field

jog height property of the tile

key property of the menu item

length property of the list

logon limit property of the user

maximum apple event processes property of the application

maximum users property of the application

number property of the error record

ordinal property of the template rectangle

pages across property of the print settings

pages down property of the print settings

post option property of the post parameters

record count property of the process ready record

record count property of the relation

record count property of the field

record id property of the retrieved data record

repeat profile property of the template

rotation property of the label rectangle

rotation property of the data rectangle

start character index property of the font style run

starting page property of the print settings

starting page number property of the view

subform count property of the template

time property of the date

type property of the structure check result

vertical spacing property of the template

year property of the date

Number

number (type) A floating point or integer number.

Description

The number datatype is a catch-all numeric type designed for coercions. For example, a string that looks like an integer or a real can be coerced to a number; the result is that it is coerced to an integer or a real, whichever is appropriate, without your having to worry about which is appropriate.

Where Used

The number type is used in the following ways:

decimal places property of the number format

decimal places property of the fixed point format

font size property of the font style

quick query value property of the quick query expression

Point

point (type)A list of two numbers, designating the x and y coordinates of a point in a plane.

Where Used

The point type is used in the following ways:

at parameter of the make

hole positions property of the tile

location property of the abacus element

location property of the tile

position property of the helix icon

tile size property of the tile

Record

record (type)An AppleScript record.

Description

A record is an unordered collection of name-value pairs. Each value may be of any type. A literal record looks like a literal list except that each item has a name, which is separated from the corresponding value with a colon:

set R to {firstname:"John", lastname:"Doe"}

There is no empty record as distinct from the empty list; the empty list {} is treated as the empty record for purposes of containment and concatenation. Records are passed to a few important commands, such as make, and are returned as a way of providing a table of information. AppleScript provides some operators for testing the contents of a record and for concatenating records to form a new record. A record can be mutated in place, and is one of the classes for which set and copy behave differently.

Where Used

The record type is used in the following ways:

properties property of the item

with properties parameter of the duplicate

with properties parameter of the make

Reference

reference (type)[synonyms: object, specifier ]A reference to an element in a collection of objects.

Description

The reference (or specifier, or object) datatype is used in a dictionary as a wild-card type, to indicate that a value will be a reference to an element, of some unspecified class, within the application.

Where Used

The reference type is used in the following ways:

direct parameter to the count

result of duplicate

direct parameter to the get

result of make

direct parameter to the print

direct parameter to the set

Text

text (type)A plain text string value.

Description

The text or string datatype is the basic text string type. It is Unicode, so it can include any character. However, the read and write scripting addition commands interpret as text or as string (or nothing) to mean MacRoman; to get UTF-16, say as Unicode text, and to get UTF-8, say as «class utf8».

A literal text string is delimited by quotation marks, with the empty string symbolized by "".

set s to "howdy"
class of s -- text

The following are the properties of a text string. They are read-only.

length
The number of characters of the text string. You can get this same information by sending the count message to the string.
quoted form
A rendering of the text string suitable for handing to the shell as an argument to a command. The text string is wrapped in single quotation marks and internal quotation marks are escaped.
id
The codepoints of the Unicode characters constituting the text string: an integer or list of integers. The reverse operation, from a list of integers to text, is through the string id specifier.

The following are the elements of a text string. They cannot be set, because a text string cannot be mutated in place.

character
A text string representing a single character of the text string.
word
A text string representing a single word of the text string. It has no spaces or other word-boundary punctuation.
paragraph
A text string representing a single paragraph (or line) of the text string. It has no line breaks. AppleScript treats a return, a newline, or both together (CRLF) as a line break.
text
A run of text. Its purpose is to let you obtain a single continuous text string using a range element specifier:
words 1 thru 3 of "Now is the winter" -- {"Now", "is", "the"}
text from word 1 to word 3 of "Now is the winter" -- "Now is the"
text item
A “field” of text, where the field delimiter is AppleScript’s text item delimiters property (or, if text item delimiters is a list, any item of that list).

Where Used

The text type is used in the following ways:

direct parameter to the do menu

direct parameter to the login

direct parameter to the utilize

as parameter of the save

collection password property of the collection

combined query expression property of the view

command label property of the command rectangle

comment property of the helix icon

content property of the label rectangle

custom labels property of the flag format

custom name property of the helix icon

date string property of the date

delimiters parameter of the utilize

disabled label property of the command rectangle

error message property of the error record

export file path property of the view

expression property of the abacus

expression property of the form query

expression property of the power query

fax number property of the print settings

field delimiter property of the view

field delimiters property of the process ready record

font name property of the font style

helix record property of the retrieved data record

ignore words property of the field

import file path property of the view

key property of the menu item

logging to parameter of the save

message property of the tile validation

message property of the sequence

name property of the application

name property of the window

name property of the helix icon

name property of the template rectangle

name property of the user menu

password parameter of the open

password property of the user

password parameter of the login

POSIX path property of the alias

POSIX path property of the file

primary constant property of the tile validation

quick query value property of the quick query expression

record delimiter property of the view

record delimiters property of the process ready record

secondary constant property of the tile validation

session data log property of the collection

short date string property of the date

start character property of the view

target printer property of the print settings

time string property of the date

user mode name property of the helix icon

user name parameter of the open

user password parameter of the open

value property of the constant

values property of the static popup

version property of the application

Type class

type class (type)[synonyms: type] A class value.

Description

The type class datatype (or class, or type ) is the value type of a value type. For example, when you ask AppleScript for the class of a value, and AppleScript tells you that it is an integer or a real or a folder or whatever, this value must itself be of some class, and this is it. There are times when it is necessary to pass a class to a command; for example, the make command needs to know what class of object to create.

Where Used

The type class type is used in the following ways:

class property of the item

each parameter of the count

new parameter of the make