ACF Library

MakeContainerFromPath

Back to List

Description: A small utility function to load a container field with the content of some file. To avoid fighting with filename paths and "Insert Image" script step.

FileMaker Prototype:

Set Field [Table::MyContainer; ACFU_MakeContainerFromPath( string_path)]

Category: UTILITY

Function source:

Function MakeContainerFromPath (string path)
    FunctionID 838; // Make ACFU_MakeContainerFromPath...
    // Some error checking
    if ( ! isServer && path == "") then // select_file not available on server. 
        path = select_file("Prompt", ""); 
    end if
    if (path == "") then
        throw "No file";
    end if
    if (! file_exists(path)) then
        throw "File does not exists: " + path; 
    end if

    // we have a valid path, make a container and return it. 
    container doc;
    Container_LoadFile(doc, path);
    return doc;
end

Back to List