Table of Contents
Unify v1.8 adds support for linked media. Every patch in a library can optionally have a link to an associated media item. Three distinct media types are supported:
About linked media and links
The presence of a link is indicated by a colored outline around the patch's library image, shown just to the right of the patch metadata banner. (See Navigating Unify's graphical user interface.) The outline color will be green for local files, or blue for URLs.
Clicking the library image opens the linked media item.
- Local image files are opened in the Unify window; click anywhere in the image to close it.
- Local HTML files are also opened in the Unify window, in a simplified browser interface with Back and Close buttons at the top.
- Internet URL links are usually opened in the user's default web browser, but these can also be opened in the Unify window if desired, in one of two ways:
- The default can be changed in the Settings view
- Holding down Option/ALT while clicking the library image will override the default on a one-time basis.
Note: the remainder of this page describes an advanced topic. You must be comfortable with creating and editing plain-text files to be able to use this technique.
Where links are defined: the links.txt file
Links for a library's patches are defined in a file links.txt which may optionally reside in the library's Media folder. This is a plain text file; you will need to have a true plain-text editor if you want to change it.
The links.txt file is basically a list of pattern / target pairs, one per line. Blank lines may be interspersed to improve legibility, and comment lines (indicated by an initial “#” symbol) may also be added to provide documentation. Here is an example:
# This is a links list. Blank lines and lines starting with "#" (comments) are ignored. # Remaining lines consist of 2 parts: a "pattern", and a "target". # Use quotation marks if pattern or target contain embedded spaces. # Unify will search down the list for the first pattern which matches the current patch name. # In patterns, "?" matches any single character, "*" matches any sequence of characters. # The target can either be a web URL or a path (relative to Media folder) to a local file. Bloo* http://192.168.1.99/phpinfo.php # URL without parameters "Colours Test" hubble_ngc3318_potw2203a_0.png # Image file in the library's Media folder "Clicking *" html/test.html # HTML file in "html" subfolder of Media folder # The pattern "*" will match anything, so I put it last in the list. # Adding "?" at the end of the web URL causes unify to append "library" and "patch" parameters # automatically, for the benefit of e.g. PHP scripts at the server end. * http://192.168.1.99/unify.php? # ?library=<library name>&patch=<patch name> will be appended
The first item on each pattern/target line can either be the full name of a patch, or a partial name, where some characters are replaced by the special characters “?” and “*”. When Unify loads a patch, it compares the new patch name against each pattern in turn, and stops at the first match. The pattern character “?” will match any single character in the patch name, and “*” will match any sequence of characters. In the example above, the last pattern in the file is “*” all by itself, which is guaranteed to match any patch name. Putting this at the end of the file guarantees that every patch in the library will be linked to the final target, if and only if its name does not match any of the earlier patterns.
- For image files, any standard image types such as .png, .jpg, etc. can be used.
- Internet URLs may optionally include a query string starting with “?” (see Uniform_Resource_Identifier).
- A single “?” at the very end of a URL will automatically be replaced by a valid query string with two attribute-value pairs as follows:
libraryattribute, with the name of the patch library as the value
patchattribute, with the full name of the patch as the value
Miscellaneous syntax details:
- Use double quotation-marks around any pattern or target which has embedded spaces.
- Spaces and tabs can be used freely on any line.
- Anything which comes after the target will be ignored (provided it is separated by at least one space or tab) and is effectively a comment.