From Vectorworks Developer
Revision as of 04:01, 7 May 2016 by Orso.b.schmid
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
DescriptionSearches for filename in all plug-in folders. Returns TRUE if the file is found, FALSE otherwise. If found, the result is returned in the path parameter.
VAR path :STRING) : BOOLEAN;
def vs.FindFileInPluginFolder(filename): return (BOOLEAN, path)
filename STRING path STRING
Remarks(Orso 2016.05.16): This routine behaves differently according to where the searched file is placed:
- if a file is placed in the upper level of the User/Plug-ins folder this will always be found
- if a file is placed anywhere else (for example in a subfolder within the User/Plug-ins folder or in the Workgroup/Plug-ins folder) the routine will
- find a file only at VW launch (you need to restart VW to make the file be found)
- nevertheless it will detect immediately if the searched file is missing
On the Mac, path will use colons instead of foreslashes as the folder delimiter.
PROCEDURE Example; VAR filename, path :STRING; BEGIN filename := 'Callout.vso'; IF FindFileInPluginFolder(filename, path) THEN AlrtDialog(path) ELSE AlrtDialog('Could not find file.'); END; RUN(Example);
def Example(): filename = 'Callout.vso'; ifFileExist, path = vs.FindFileInPluginFolder(filename) if ifFileExist: vs.AlrtDialog(path) else: vs.AlrtDialog('Could not find file.') Example()