GetFolderItemText(path As String, optional pathmode As Integer) As String

 

Returns the contents of a textfile.

 

Using this GetFolderItemText on OSX, one can only access files inside of the sandbox container.

 

If the first parameter path contains only a filename (without any slash character "/"), then the document will be looked up in the Documents folder.

 

On OSX this would be the documents folder inside of the sandbox container.

 

 

Parameters:

 

Name

Type

Description

path

String

Filename of a textfile whose contents will be retrieved.

If a filename is given without a path, then the path to the documents folder will be added. The textfile will be searched insided of the documents folder. On OSX the Documents folder is inside of the Seminar.pro application sandbox.

 

Example for a path to file test.txt inside of the sandboxed Documents container on OSX:

 

/Users/user1/Library/Containers/com.osswald.pro.seminar/Data/Documents/test.txt

Pathmode

Integer

PathTypeAbsolute = 0

PathTypeShell = 1

PathTypeURL  = 2

PathTypeNative  = 3  // DEFAULT value. On OSX: path separated by slashes

 

If no Pathmode parameter is given, then PathTypeNative will be used automatically.

 

 

Returns:

 

Type

Value

Description

String

Contents of textfile

Any readable contents of a textfile is returned.

 

Available in:

 

WindowMain

WindowLink

YES

NO

 

 

Example XojoScript:

 

Dim path As String = "/Users/user1/Library/Containers/com.osswald.pro.seminar/Data/Documents/test.txt"

Dim contents As String = GetFolderItemText(path)

MsgBox(contents)