You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 040a0e3
Browse filesBrowse the repository at this point in the historyBrowse files
After the library has been loaded, these primary XMP classes are available in the global JavaScript namespace:
13
13
14
-
|[XMPMeta object](xmpscript-object-reference.md#xmpmeta-object)| Provides the core services of the XMP Toolkit. Allows you to create and delete<br/>metadata properties, and to retrieve and modify property values. |
|[XMPFile object](xmpscript-object-reference.md#xmpfile-object)| Provides convenient I/O access to the main, or document level, XMP for a file. Allows<br/>you to retrieve existing metadata from a file, update file metadata, and add new<br/>metadata to a file. |
|[XMPMeta object](xmpscript-object-reference.md#xmpmeta-object)| Provides the core services of the XMP Toolkit. Allows you to create and delete<br/>metadata properties, and to retrieve and modify property values. |
17
+
|[XMPFile object](xmpscript-object-reference.md#xmpfile-object)| Provides convenient I/O access to the main, or document level, XMP for a file. Allows<br/>you to retrieve existing metadata from a file, update file metadata, and add new<br/>metadata to a file. |
17
18
18
19
Additional top-level objects include array-handling utilities, a date-time object, and constant definitions that include namespace constants. The top-level objects provide access to additional support classes that encapsulate individual metadata properties, file information, and XMP packet information, and a utility that allows iteration through properties.
19
20
@@ -37,22 +38,25 @@ In Adobe Bridge, you can pass XMP metadata between the built-in `Metadata` objec
37
38
```javascript
38
39
var thumb =newThumbnail( newFile( "/C/myImage.jpg") );
39
40
app.synchronousMode=true;
40
-
xmp =newXMPMeta( thumb.metadata.serialize() );
41
+
42
+
var xmp =newXMPMeta( thumb.metadata.serialize() );
41
43
```
42
44
43
45
or:
44
46
```javascript
45
-
xmp = new XMPMeta( thumb.synchronousMetadata.serialize() );
47
+
var xmp = new XMPMeta( thumb.synchronousMetadata.serialize() );
46
48
```
49
+
47
50
- You can modify the metadata in an Adobe Bridge thumbnail by creating a new`Metadata` object with serialized XMP. Continuing the previous example:
var newPacket = xmp.serialize( XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT ) );
51
54
thumb.metadata = new Metadata( newPacket );
52
55
```
56
+
53
57
- To write metadata back to the file for a thumbnail, you can access the thumbnail's file and create an [XMPFile object](xmpscript-object-reference.md#xmpfile-object) object to access the embedded metadata directly:
54
58
```javascript
55
-
xmp = new XMPFile( thumb.spec.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
59
+
var xmp = new XMPFile( thumb.spec.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
56
60
```
57
61
58
62
!!! note
@@ -65,12 +69,12 @@ In Adobe Bridge, you can pass XMP metadata between the built-in `Metadata` objec
65
69
This code creates an empty [XMPMeta object](xmpscript-object-reference.md#xmpmeta-object), uses it to set a metadata property, and serializes it to a string, which you could pass to an authoring tool, for example, or store in a file.
66
70
67
71
```javascript
68
-
xmp = new XMPMeta();
72
+
var xmp = new XMPMeta();
69
73
xmp.setProperty( XMPConst.NS_XMP, "CreatorTool", "My Script" );
70
-
xmpStr = xmp.serialize(); // Serialize the XMP packet to XML
74
+
var xmpStr = xmp.serialize(); // Serialize the XMP packet to XML
This code accesses an existing XMP packet, assuming the location has been assigned to a string variable. It sets the modification-date property to the current date and time, and stores the updated XMP packet back to the string, making it as small as possible.
84
88
85
89
```javascript
86
-
xmp = new XMPMeta( xmpStr ); // Object initialized with xmp packet as string
0 commit comments