Lingo Dictionary > S > searchPaths |  |

searchPaths

Syntax

    the searchPaths

Description

System property; a list of paths that Director searches when trying to find linked media such as digital video, GIFs, bitmaps, or sound files. Each item in the list is a fully qualified pathname as it appears on the current platform at run time.

The value of `searchPaths` is a linear list that you can manipulate the same as any other list by using commands such as `add`, `addAt`, `append`, `deleteAt`, and `setAt`.

URLs should not be used as file references in the search paths.

Adding a large number of paths to `searchPaths` slows searching. Try to minimize the number of paths in the list.

This property can be tested and set, and is an empty list by default.

Note: This property will function on all subsequent movies after being set. Because the current movie's assets have already been loaded, changing the setting will not affect any of these assets.

Example

This statement displays the paths that Director searches when resolving file names:

    put the searchPaths

Example

This statement assigns two folders to `searchPaths` in Windows. This version includes optional trailing backslashes.

    set the searchPaths = ["c:\director\projects\", "d:\cdrom\sources\"]

This statement is the same, except that trailing backslashes have been omitted:

    set the searchPaths = ["c:\director\projects", "d:\cdrom\sources"]

Example

This statement assigns two folders to `searchPaths` on a Macintosh. This version includes optional trailing colons.

    set the searchPaths = ["hard drive:director:projects:", "cdrom:sources:"]

This statement is the same, except that trailing colons have been omitted:

    set the searchPaths = ["hard drive:director:projects", "cdrom:sources"]

Example

These statements cause Director to search in a folder named Sounds, which is in the same folder as the current Director movie:

    set soundPaths = the moviePath & "Sounds"
    add the searchPaths, soundPath

See also

`searchCurrentFolder`, `@ (pathname)`