from Spotfire.Dxp.Application import DocumentMetadata
print Application.DocumentMetadata.LoadedFromLibraryPath
Here are more properties from DocumentMetadata
Name | Description | |
---|---|---|
FileNameUsedBySave |
Gets the current file name used by save operations initiated by the user.
| |
IsDirty |
Returns true if the document has been changed since it was last saved.
| |
LibraryItemUsedBySave |
Gets the library item that the analysis was last saved to in the library; otherwise null.
| |
LoadedFromFileName |
Gets the file name that the analysis was opened from; otherwise null.
| |
LoadedFromLibraryItem |
Gets the library item that the analysis was opened from; otherwise null.
| |
LoadedFromLibraryPath |
Gets the library path that the analysis was opened from; otherwise null.
|
If the analysis is located in the library, then use the LibraryItemUsedBySave
from Spotfire.Dxp.Application import DocumentMetadata
libraryItem = Application.DocumentMetadata.LibraryItemUsedBySave
print "size:\t\t", libraryItem.ContentSize
print "date created:\t", libraryItem.Created
print "description:\t", libraryItem.Description
print "guid:\t\t", libraryItem.Id
print "last modified:\t",libraryItem.LastModified
print "location:\t\t",libraryItem.Path
print "Title\t\t",libraryItem.Title
result:
size: 685362
date created: 9/11/2016 10:19:43 AM
description: Document Metadata Test
guid: 6f072612-7c3c-4653-a2e9-f76ce6f45dc3
last modified: 9/12/2016 10:19:43 AM
location: /Analysis/lab/documentMetaData
Title documentMetaData
2 comments:
How about the date a document was created, can Spotfire read that when importing the file? I'd like to display that date in Spotfire, if possible.
Hello Bob,
If the analysis was saved to the library:
from Spotfire.Dxp.Application import DocumentMetadata
print Application.DocumentMetadata.LibraryItemUsedBySave.Created
Check out the LibraryItem Members
Post a Comment