Home > Mobile >  Is there a function for reading file location from a file open in DM
Is there a function for reading file location from a file open in DM

Time:12-29

Is there a function for reading "file location" from an image open in DM? Under ImageInfo/Image/Info, at the bottom of the window, I can read the path under "File location".

Can I use a script call to grab that info as full path - and what is the function call?

Thanks, Edgar

CodePudding user response:

Yes. Note, however, that it is the ImageDocument that is tied to a file, not an Image. As such, the command is method of the ImageDocument object.

String ImageDocumentGetCurrentFile( ImageDocument img_doc )

A typical script would be like:

imageDocument doc = GetFrontImage().ImageGetOrCreateImageDocument()

if ( doc.ImageDocumentIsLinkedToFile() )
    Result("\n File of current front image:"   doc.ImageDocumentGetCurrentFile())
else
    Result("\n Current front image is not linked to a file.")

You may also find this answer useful.

  • Related