This article is part of a series that describes how to use Elvis 6 with Adobe InDesign.
In this article, the InDesign scripting events are shown that are available for use with Elvis 6.
Application
Methods
- Returns: A string with the result of the request.
- Description: This method will perform a PostRequest (REST API) on the Elvis server with the passed path and query.
Parameter | Type | Description | Required? |
---|---|---|---|
requestPath | String | The path of the request. Should start with '/'. | Yes |
queryArray | Array with arrays of 3 strings. | An array with arrays with strings for key, value and type (String or File) of the query parameters | Yes |
- Sample script:
Prerequisites: The user should be logged in. Script:
Result: An alert box with the json that describes all child folders and collections of the root folder of the Elvis Server. |
- Returns: A string with the result of the request.
- Description: This method will perform a GetRequest (REST API) on the Elvis server with the passed path and query.
Parameter | Type | Description | Required? |
---|---|---|---|
requestPath | String | The path of the request. Should start with '/'. | Yes |
queryArray | Array with arrays of 2 strings. | An array with arrays with strings for key and value of the query parameters. | Yes |
- Sample script:
Prerequisites: The user should be logged in. Script:
Result: An alert box with the json that describes the profile of the user. |
- Returns: The opened document.
- Description: Opens the document with the passed Elvis ID.
Parameter | Type | Description | Required? |
---|---|---|---|
objectId | String | Elvis ID of the object to open. | Yes |
checkOutFile | Boolean | Checks-out the file from Elvis when set to true. | Yes |
- Sample script:
Prerequisites: The user should be logged in. Script:
Result: The document with the passed Elvis ID is checked-out and opened. |
Properties
- Returns: Boolean
- Description: Turns off and on WoodWing logging.
- Access mode: Read/write
- Sample script:
Prerequisites: None. Script:
Result: The WoodWing logging is enabled. |
Document
Methods
- Returns: Nothing
- Description: This method will make sure that the latest version of all linked Elvis files in the document are downloaded to the local machine. When a newer version of a file is downloaded then currently placed on the document, the link will be updated with this new version.
- Sample script:
Prerequisites: A document with at least one linked Elvis image that is not downloaded when opening the document, for example because the latest version was already placed on the document. Script:
Result: The latest versions of all linked Elvis files are downloaded to the Elvis Checkouts folder. When the version is newer than the version on the document the link is updated with the contents of the version. |
- Returns: Nothing
- Description: Closes and checks-in the document or performs an undo action of the check-out when needed. The document will not be saved before check-in.
Note: If you want to have a preview of the InDesign document in Elvis you need to start InDesign Server with an extra '-preview' argument such as: 'InDesignServer -previews -port <...>'. Without this setting InDesign Server will not add a preview to the file and Elvis will not be able to show a file preview.
Parameter | Type | Description | Required? |
---|---|---|---|
checkInFile | Boolean | Checks-in the file to Elvis when set to true. * | Yes |
undoCheckOutFile | Boolean | Reverts the file check-out in Elvis when set to true. * | Yes |
* When both checkInFile and undoCheckOutFile are set to true the file will be checked in.
- Sample script:
Prerequisites: An opened Elvis document. Script:
Result: The document will be checked-in and closed. The local file will be removed from disk. |
- Available since: Version 3.3.0
- Returns: Nothing
- Description: Relinks as many as possible placed files to assets in Elvis. Similar to the Relink All menu command.
Properties
- Returns: String
- Description: The Elvis ID of the document. Returns an empty string when the document is not an Elvis document.
- Sample script:
Prerequisites: A document with at least one linked Elvis image. Script:
Result: The Elvis ID of the document will be shown in an alert dialog. |
Link
Methods
- Returns: Nothing
- Description: This method will make sure that the latest version of the linked Elvis file is downloaded to the local machine. When a newer version of the file is downloaded then currently placed on the document, the link will be updated with this new version.
- Sample script:
Prerequisites: A document with at least one linked Elvis image that is not downloaded when opening the document, for example because the latest version was already placed on the document. Script:
Result: The latest versions of the first linked Elvis file is downloaded to the Elvis Checkouts folder. When the version is newer than the version on the document the link is updated with the contents of the version. |
Properties
- Returns: String
- Description: The Elvis ID of the link. Returns an empty string when the link is not an Elvis link.
- Access mode: Read-only
- Sample script:
Prerequisites: A document with at least one linked Elvis image. Script:
Result: Shows an alert with the Elvis id of the link. |
- Returns: String
- Description: The Elvis URL of the link. Returns an empty string when the link is not an Elvis link.
- Access mode: Read-only
- Sample script:
Prerequisites: A document with at least one linked Elvis image. Script:
Result: Shows an alert with the Elvis Url of the link. |
- Returns: String
- Description: The path of the link in Elvis. Returns an empty string when the link is not an Elvis link.
- Access mode: Read-only
- Sample script:
Prerequisites: A document with at least one linked Elvis image. Script:
Result: Shows an alert with the path of the linked file in Elvis. |
- Returns: String
- Description: The local file path of the link. Returns also a path for non-Elvis links.
Note: This call is introduced because Link.filePath does not work for custom datalinks.
- Sample script:
Prerequisites: A document with at least one linked Elvis image. Script:
Result: Shows an alert with the path of the linked file in Elvis. |
PageItem
Methods
- Returns: Nothing
- Description: This method places an object in the page item using the Elvis Server that the user is logged on to.
Parameter | Type | Description | Required? |
---|---|---|---|
objectId | String | Elvis ID of the object to place | Yes |
- Sample script:
Prerequisites: An opened or new document. Script:
Result: A page item will be created on the document and the file with the passed <Elvis_Id> will be placed into this frame. |
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.