The Smart Objects API

Note:

Smart Objects function is discontinued in Dreamweaver version 21.0.

The Smart Object functions handle operations related to Dreamweaver and Photoshop integration. The functions enable you to perform the following tasks:

  • Retrieve the state of an image

  • Retrieve the height and width of an image

dreamweaver.assetPalette.canUpdateSmartObjectFromOriginal()

Availability

Dreamweaver CS4.

Description

Enabler: This function checks to see whether a Smart Object, on which we can issue the command "Update From Original," is selected in the Assets panel.

Arguments

None.

Returns

A Boolean value: true if "Update From Original" can be applied to current selection. false otherwise.

dreamweaver.assetPalette.updateSmartObjectFromOriginal()

Availability

Dreamweaver CS4.

Description

This function re-creates the selected web image based on the current contents of the connected original source file.

Arguments

None.

Returns

None.

dreamweaver.getSmartObjectState()

Availability

Dreamweaver CS4.

Description

This function returns the state of a web image in terms of Smart Objects functionality.

Arguments

Absolute local URL of a web image.

Returns

The state of the Smart Object as a numeric value such as:

Numeric value

Description

-10

Unknown error

0

No Smart Object

1

In sync with contents of the original asset file

100

Web image modified after last sync

200

Original asset modified after last sync

+2

Dimensions of the original asset differ from width and height attributes in HTML

+4

Dimensions of web image differ from width and height attributes in HTML

10

Unable to access the original asset file

20

Unable to access web image file

dreamweaver.getSmartObjectOriginalWidth()

Availability

Dreamweaver CS4.

Description

This function evaluates and returns the pixel width of the original asset file of a Smart Object.

Arguments

Absolute local URL of the web image.

Returns

Pixel width of the original asset file.

dreamweaver.getImageWidth()

Availability

Dreamweaver CS4.

Description

This function evaluates and returns the pixel width of an image.

Arguments

Absolute local URL of a web image.

Returns

Pixel width of the image.

dreamweaver.getImageHeight()

Availability

Dreamweaver CS4.

Description

This function evaluates and returns the pixel height of an image.

Arguments

Absolute local URL of a web image.

Returns

Pixel height of the image.

dreamweaver.resolveOriginalAssetFileURLToAbsoluteLocalFilePath()

Availability

Dreamweaver CS4.

Description

This function resolves a file path to an original asset file (as it is stored in Design Notes). The path can be empty, site relative, or absolute.

Arguments

Absolute local URL or site relative URL to the web image. This URL is required to resolve the site.

Returns

Absolute local file path.

dreamweaver.canUpdateSmartObjectFromOriginal()

Availability

Dreamweaver CS4.

Description

This function answers the question whether a Smart Object can be updated from its original asset file.

Arguments

Numeric status of Smart Object. ImageManipulatorSettings:GetSmartObjectStatus() returns this status.

Returns

A Boolean value: true if an update from the original image can be performed according to the status; false otherwise.

dreamweaver.updateSmartObjectFromOriginal()

Availability

Dreamweaver CS4.

Description

This function updates a web image based on the current contents of an original asset file.

Arguments

Absolute local URL of a web image.

Returns

None.

 Adobe

Get help faster and easier

New user?