Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

AppleScript Changes

This section discusses the changes to AppleScript in QuickTime 6.

In this section:

Recordability
Terminology Changes


Recordability

QuickTime Player is now a recordable application. To take advantage of this new capability, you must use QuickTime Player in conjunction with an application that supports AppleEvent recording, such as Script Editor.

Using Script Editor to record a script, you need to make sure that both QuickTime Player and Script Editor are running. Then you click the record button in a script window. Any operation you perform in QuickTime Player will be recorded in the open script document.

Most features of QuickTime Player are recordable with the following exceptions:

The result of a AppleEvent recording session is rarely a finished script, but rather more like a summary of the operations you would like performed. A recorded script will have no error checking code nor if/then/else or repeat/until structures. Quite often, a recorded script will merely demonstrate the correct syntax for an operation and little more.

Terminology Changes

QuickTime Player introduces a number of new commands, classes, and properties, and well as modifications to existing terminology elements, discussed in this section.

New Commands

The following new commands are introduced in QuickTime 6:

These two commands make it possible to enter and exit full screen mode independent of movie playback. This means that in QuickTime 6 you can create a script that will put the player in full screen mode and then perform other operations, including opening and playing movies while remaining in full screen mode. Once the script has finished presenting movies, it is necessary to call exit full screen to restore the computer to its normal state.

enter full screen: Enter full screen video mode

    enter full screen  reference  -- display
        [bounds  point]  -- the desired target dimensions of the display
                            (height, width)
        [background color  rgb color]  -- the background color

exit full screen: Exit full screen video mode

    exit full screen  reference  -- display

The following script demonstrates how to use these two commands to enter full screen mode, present a sequence of movies, then exit full screen mode:

    tell display 1 to enter full screen
    tell movie 1 to play
    tell movie 2 to play
    tell movie 3 to play
    tell display 1 to exit full screen

The following commands perform matrix manipulation on tracks and movies. While it is possible to achieve the same results by setting the matrix property directly (see current matrix, below), these commands serve as useful shortcuts and correspond to familiar menu commands and property window operations.

flip horizontal: Flip an object along the horizontal axis
    flip horizontal  reference  -- the object to flip
flip vertical: Flip an object along the vertical axis
    flip vertical  reference  -- the object to flip
resize: Scale an object
    resize  reference  -- the object to scale
        [by  small real]  -- the percent of current size
        [around  fixed point]  -- the point to resize around
rotate: Rotate an object by an arbitrary amount
    rotate  reference  -- the object to rotate
        by  small real  -- the amount of rotation (in degrees)
        [around  fixed point]  -- the point to rotate around
rotate left: Rotate an object 90 left
    rotate left  reference  -- the object to rotate
rotate right: Rotate an object 90 right
    rotate right  reference  -- the object to rotate
skew: Skew an object by an arbitrary amount
    skew  reference  -- the object to skew
        by  fixed point  -- the amount of skew
        [around  fixed point]  -- the point to skew around
translate: Translate the object some distance
    translate  reference  -- the object to translate
        by  fixed point  -- the distance to translate

The replace command performs an operation equivalent to the Edit/Replace menu item.

replace: Replace the current selection with an object from the clipboard
    replace  reference  -- movie

The invert command inverts an image. This is primarily useful for inverting a bitmap before using it set the new track mask property.

invert: Invert an object
    invert  reference  -- the object to invert

The save export settings command is used to save the specified exporter settings to a file. This file can then be used with the export command.

save export settings: Save an exporters settings
    save export settings
        for  AVI/BMP/DV stream/Fast Start QTVR Movie/FLC/hinted movie/image sequence/interframe
 compressed VR object movie/MPEG4/picture/QuickTime media link/QuickTime movie/AIFF/System 7 sound/
wave/MuLaw/standard MIDI/text file  -- the desired file type
        [to  alias]  -- the destination file
        [replacing  boolean]  -- should the original file be deleted
first?

Enhanced Commands

Command export

The export command has additional export options: Fast Start QTVR Movie, interframe compressed VR object movie, MPEG 4, and QuickTime media link.

An optional parameter using settings preset has also been added that allows the use of an export settings file (see save export settings command, above).

export: Export a movie or track to a file
    export  reference  -- the movie or track to export
        to  alias  -- the destination file
        as  AVI/BMP/DV stream/Fast Start QTVR Movie/FLC/hinted movie/image sequence/interframe
 compressed VR object movie/MPEG4/picture/QuickTime media link/QuickTime movie/AIFF/System 7 sound/
wave/MuLaw/standard MIDI/text file  -- the desired file type
        [using  default settings/most recent settings]  -- the export settings to use
        [using settings preset  string]  -- the name of the export settings preset to use
        [using settings  alias]  -- the file containing the export settings
        [replacing  boolean]  -- should the original file be deleted first?
Command make

The make command can be used to create movie, track, frame and favorite objects. The syntax for each is shown below:

    make new movie with data {frame 6 of track "Video Track" of movie "QuickTime Sample Movie"}
    make new movie with data {track "Video Track" of movie "QuickTime Sample Movie"}
    make new track at first movie with data alias "myharddrive.myimage.jpeg"
    make new favorite with data "http://stream.qtv.apple.com/myevent.mov"
    make new favorite with file "myharddrive:mymovie.mov"

New Properties

New Application Properties

The following Boolean properties can be set to show or hide the various non-movie windows:

    show favorites window  boolean  -- show the favorites window
    show movie info window  boolean  -- show the movie info window
    show welcome movie automatically  boolean  [r/o]  -- always show the hot picks movie when the application launches
New Movie Properties

The following properties control audio playback characteristics:

    bass gain  small integer  -- the bass setting for the track (-256..256) (not saved with the movie)
    sound balance  small integer  -- the balance of the movie (-128..128), where negative is left, 0 is center, and positive  is right
    treble gain  small integer  -- the treble setting for the movie (-256..256) (not saved with movie)
    preferred audio balance track  track  [r/o]  -- the preferred track to use for balance settings
    preferred audio gain track  track  [r/o]  -- the preferred track to use for bass and treble gain settings

The color table property allows a scripter to specify a color palette for movies that support palettes:

    color table  palette  -- palette for the movie

The current chapter track property permits easy access to the current chapter track of the movie:

    current chapter track  track  [r/o]  -- the currently active chapter track (may differ by language)

The current matrix property describes the current transformation applied to the movie:

    current matrix  matrix  -- the matrix of the movie

The following boolean properties control user interface elements:

    show detailed movie info window  boolean  -- show the movie property window
    show sound controls  boolean  -- show the sound controls in the LCD
    show video controls  boolean  -- show the video controls

The following properties control the visual appearance of the movie and perform actions corresponding to the video controls:

    video brightness adjustment  small real  [r/o]  -- the adjustment to the video brightness (range is -1.0 to 1.0)
    video contrast adjustment  small real  [r/o]  -- the adjustment to the video contrast (range is -1.0 to 1.0)
    video tint adjustment  small real  [r/o]  -- the adjustment to the video tint (range is -0.25 to 0.25)
    video color adjustment  small real  [r/o]  -- the adjustment to the video color
New Track Properties

The alternate track property permits one track to be specified as the alternate of another. This is useful for making multi-language movies that automatically enable a track based on the current system language.

    alternate  track  [r/o]  -- the alternate for this track

The following properties control audio playback characteristics of audio tracks:

    bass gain  small integer  -- the bass setting for the track (-256..256) (not saved with movie)
    treble gain  small integer  -- the treble setting for the track (-256..256) (not saved with movie)

The following properties control visual playback characteristics of visual tracks:

    mask  image  -- the mask of the track
    current matrix  matrix  -- the matrix of the track
    transfer mode  transfer mode unknown/dither copy/no dither copy/blend/transparent/straight alpha/premul
 white alpha/premul black alpha/straight alpha blend/composition  -- the transfer mode of the track

New Classes

Class matrix

The matrix class describes a 3 x 3 transformation matrix which can be applied to a movie or track. Commands such as rotate left and flip actually modify the current matrix property of the target object. The contents of a matrix can be set by a list of the following format: “{{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}”. This particular matrix is know as the identity matrix and describes an object in its default state with no transformations applied. Constructing or manipulating a matrix directly requires knowledge of matrix math operations.

Properties
    class  type class  [r/o]  -- the class
    contents  type class  -- the contents of the matrix
Class Palette

A palette object is a list of rgb colors (see below). Some movies permit specifying a palette which describes the set of colors to be used when displaying the movie.

Elements:

    rgb color by numeric index
Properties
    class  type class  [r/o]  -- the class
    contents  type class  -- the contents of the matrix
Class rgb color

The class describes a color using three magnitudes: one each for the red, green, and blue color components.

Properties
    class  type class  [r/o]  -- the class
    contents  type class  -- the contents of the rgb color
    red  small integer  -- the mangnitude of the red component
    green  small integer  -- the mangnitude of the green component
    blue  small integer  -- the mangnitude of the blue component


< Previous PageNext Page > Hide TOC


Last updated: 2002-07-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice