Adobe InDesign CS2 (4.0) Object Model JS: Link

InDesign CS2

Class

Link

 A link to a placed file.

QuickLinks

copyLink, editOriginal, extractLabel, getElements, insertLabel, relink, revealInBridge, revealInSystem, saveAVersion, show, toSource, toSpecifier, unembed, unlink, update

Hierarchy

Graphic | Movie | Sound | Story
Link
LinkMetadata

Properties

PropertyTypeAccessDescription
assetEtagstring readonlyThe asset etag of the linked object.
assetIDstring readonlyThe asset ID of the linked object.
assetURLstring readonlyThe asset URL of the linked object.
dateDate readonlyThe date and time the Link was created.
editedbool readonlyIf true, indicates the linked object has been edited in the current document but the source file has not been updated.
editingStateEditingState:
EditingState.EDITING_UNKNOWN
EditingState.EDITING_NOWHERE
EditingState.EDITING_REMOTELY
EditingState.EDITING_LOCALLY
EditingState.EDITING_LOCALLY_LOCKED
EditingState.EDITING_CONFLICT
readonlyThe Version Cue editing state of the file.
filePathFile readonlyThe full path to the file.
idnumber readonlyThe unique ID of the Link.
indexnumber readonlyThe index of the link in the links collection.
labelstring r/wA property that can be set to any string.
linkTypestring readonlyThe file type of the linked object.
linkXmpLinkMetadata readonlyXMP data for the link source file.
namestring readonlyThe name of the Link.
neededbool readonlyIf true, indicates a link to a full-resolution version of the source file is needed. If false, indicates the object is embedded.
parentGraphic
Movie
Sound
Story
readonlyThe linked object. Can return: Story, Graphic, Movie or Sound.
propertiesObject r/wA property that allows setting of several properties at the same time.
sizenumber readonlyThe size of the Link file.
statusLinkStatus:
LinkStatus.NORMAL
LinkStatus.LINK_OUT_OF_DATE
LinkStatus.LINK_MISSING
LinkStatus.LINK_EMBEDDED
readonlyThe status of the link.
stockStateLinkStockState:
LinkStockState.LINK_IS_NOT_STOCK
LinkStockState.LINK_IS_STOCK_COMP
LinkStockState.LINK_IS_STOCK_HIGH_RESOLUTION
readonlyThe stock state of the source file image.
versionStateVersionState:
VersionState.VERSION_UNKNOWN
VersionState.PROJECT_FILE_NEWER
VersionState.LOCAL_PROJECT_MATCH
VersionState.LOCAL_NEWER
VersionState.VERSION_CONFLICT
VersionState.NO_RESOURCE
readonlyThe Version Cue version state of the file.

Methods

Instances

void copyLink (to: File)
Makes a copy of the source file and places it in the specified folder. If a file name is specified in the file path, renames the copied file. Note: Cannot be used to change the file type.

ParameterTypeDescription
toFileThe folder to which to copy the file. To rename the file, include the file name in the path.

void editOriginal ()
Opens the source file of the link in the default editor for the source file type.

string extractLabel (key: string)
Gets the label value associated with the specified key.

ParameterTypeDescription
keystringThe key.

Array of Object getElements ()
Resolves the object specifier, creating an array of object references.

void insertLabel (key: string, value: string)
Sets the label to the value associated with the specified key.

ParameterTypeDescription
keystringThe key.
valuestringThe value.

void relink (to: File)
Points the link to a new source file.

ParameterTypeDescription
toFileThe full path name of the new source file.

void revealInBridge ()
Opens Adobe Bridge and selects the source file of the link.

void revealInSystem ()
Opens the file system to the folder that contains the source file of the link, and selects the file.

void saveAVersion ([versionComments: string][, forceSave: bool=false])
Saves a version to Version Cue.

ParameterTypeDescription
versionCommentsstringThe comments that describe the version. (Optional)
forceSaveboolIf true, forcibly saves the version. (Optional) (default: false)

void show ()
Selects the link.

string toSource ()
Generates a string which, if executed, will return the Link.

string toSpecifier ()
Retrieves the object specifier.

void unembed ([to: File])
Unembeds the source file. If no folder is specified, creates a link to the original source file; if a folder is specified, copies the file to the folder and creates a link to the copied file.

ParameterTypeDescription
toFileThe folder to which to copy the unembedded file. (Optional)

void unlink ()
Embeds the source file in the document.

Link update ()
Updates the link if the source file has been changed.

Element of

EPS.itemLink

Graphic.itemLink

Image.itemLink

LinkMetadata.parent

Movie.itemLink

PDF.itemLink

PICT.itemLink

Sound.itemLink

Story.itemLink

WMF.itemLink

Used in:

array of Link Links.itemByRange (from: any, to: any)

Link Links.nextItem (obj: Link)

Link Links.previousItem (obj: Link)

Return

Link Link.update ()

Link Links.anyItem ()

Array of Link Links.everyItem ()

Link Links.firstItem ()

Link Links.item (index: any)

Link Links.itemByID (id: number)

Link Links.itemByName (name: string)

Array of Link Links.itemByRange (from: any, to: any)

Link Links.lastItem ()

Link Links.middleItem ()

Link Links.nextItem (obj: Link)

Link Links.previousItem (obj: Link)

Jongware, 27-Jun-2010 v3.0.3dContents :: Index