Difference between revisions of "VS:GetFolder"

From Vectorworks Developer
Jump to: navigation, search
(add comment from vectorlab)
 
m (1 revision)

Revision as of 10:30, 12 August 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Prompts for the selection of a folder. Defaults to the folder name in the argument list. Returns 0 if the user hits OK, and -1 if the user hits cancel.
FUNCTION GetFolder(
promptStr  :STRING;
VAR directoryPath  :STRING) :INTEGER;
def vs.GetFolder(promptStr):
    return (INTEGER, directoryPath)

Parameters

promptStr STRING
directoryPath STRING Output parameter.

Remarks

On the Mac, directoryPath will use foreslashes instead of colons.

Orso 2010.09.24: Foreslashes on Mac have been introduced by VW12. If you happen to script for older versions, be aware that this routines returned path with colons until VW11.

Example

PROCEDURE Example;
VAR
   promptStr :STRING; 
   directoryPath :STRING;
   result :INTEGER;
BEGIN
   promptStr := 'Select the folder...';
   directoryPath := GetFolderPath(2);
   result := GetFolder(promptStr, directoryPath);
   Message(directoryPath);
END;
RUN(Example);

Version

Availability: from All Versions

This is drop-in function.

Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox