MTRobin Posted April 29, 2019 Share Posted April 29, 2019 Can someone walk me through how to use a script to save a file to a user defined location? I am creating a script and the last piece of the puzzle is to save a copy of the current file. I would like a pop up window to appear so the user can select the file destination. I have tried all the procedures and functions and I cannot get it to work. Thank you Maxwell Quote Link to comment
PatW Posted April 30, 2019 Share Posted April 30, 2019 Hi MTRobin, you could invoke the menu comand "Save copy as..." by http://developer.vectorworks.net/index.php/VS:DoMenuTextByName Quote Link to comment
MTRobin Posted April 30, 2019 Author Share Posted April 30, 2019 That worked great! Thank you. Do you know of a way I could save as, and it will save the new document with a new name in the same location as the current one? Quote Link to comment
danm01 Posted April 30, 2019 Share Posted April 30, 2019 I think your best bet for that would be to use Python. There are a bunch of options for working with file and folder structure using os (https://docs.python.org/3/library/os.html). I wrote a script to snapshot an open file to a subfolder in the current directory using os. You can definitely do what you're looking for, but not necessarily with Vectorscript. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.