VS:SaveActiveDocument: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Transfer Orso to _c_) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 30: | Line 30: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark></remark> | <remark> | ||
([[User:CBM-c-|_c_]], 2014.09.20): Introduced by VW 10 (not 2010!), made public for VW 2014. This is predestinated to usage with Applescript, since it's dialog-free. Probably created for that precise usage, since I am not aware of a single command in the main application that could be using it. | |||
It corresponds to "save as" but without dialog. Saving on the same file path name doesn't work (returns -1), only if the file path is different (returns 0). | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample></sample> | <sample><code lang="pas"> | ||
PROCEDURE Test; | |||
VAR | |||
temp_l : LONGINT; | |||
BEGIN | |||
{ save the current file in the application folder } | |||
temp_l := SaveActiveDocument(concat(getFolderPath(1), 'try.mcd')); | |||
END; | |||
Run(Test); { _c_ }</code> | |||
</sample> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Latest revision as of 05:08, 30 December 2020
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Saves a file with out presenting dialogs
FUNCTION SaveActiveDocument(
filePath :STRING) : LONGINT;
def vs.SaveActiveDocument(filePath): return LONGINT
Parameters
filePath STRING
Remarks
(_c_, 2014.09.20): Introduced by VW 10 (not 2010!), made public for VW 2014. This is predestinated to usage with Applescript, since it's dialog-free. Probably created for that precise usage, since I am not aware of a single command in the main application that could be using it.
It corresponds to "save as" but without dialog. Saving on the same file path name doesn't work (returns -1), only if the file path is different (returns 0).
Example
PROCEDURE Test; VAR temp_l : LONGINT; BEGIN { save the current file in the application folder } temp_l := SaveActiveDocument(concat(getFolderPath(1), 'try.mcd')); END; Run(Test); { _c_ }
Version
Availability: from Vectorworks 2014