documentFilename

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the documentFilename of <stack> to <filename>
Associationsstack
Summary

Specifies the file path to the file that the stack represents.

Introduced8.0
OSmac, windows, linux, ios, android
Platformsdesktop
Parameters
NameTypeDescription
Stack

The name or ID of the stack.

Filename

The full or relative path to the document.

Example
answer file "Open document"
if it is not empty then
  put it into theFilename
  set the documentFilename of stack "Template Document Editor" \
        to theFilename
  clone stack "Template Document Editor"
end if
put the documentFilename of this stack into theFilename
if theFilename is not empty then
  # load data from file
  try
    put arrayDecode(url ("binfile:" & theFilename)) into theDataA
    # load the data into the UI
    UpdateWithData theDataA
  catch error
    # file corrupted
  end try
end if
Description

Use the documentFilename property to associate a stack being presented to the user with a document on disk.

On mac setting the documentFilename property will set the represented filename of the window. The window will show an icon for the file next to the window title.

On other platforms there is no visual representation of the association between the stack and the document filename but the property may still be used to manage the association.

Note: The documentFilename property is not persistent (not saved into the stackfile).

Tagswindowing