Julian Carr Posted July 26, 2018 Share Posted July 26, 2018 We are using a lot of saved views in our training and have added a script to each saved view to open the message window with some instructions that pertain to each particular step. This allows users to be able to work in the file while still having the instructions visible and unaffected by view changes, panning or zooming. The notes for each of the message strings come from a worksheet within the file. There are two things that would make this process better. 1. Being able to get the name of the current saved view that is running the script. 2. Being able to access the script via an include file. Can anyone think of a way to do either of these things? Because we run training courses at a 3rd party training venue, we generally can only install the training files in a folder on the Desktop of each machine, so the potential path to any include file will be different on each machine. Thanks for any ideas. Julian PS. I discovered that you can get around the limitation of 256 characters in a message, by concatenating a series of sub 256 character strings together within the message call. Quote Link to comment
Nicolas Goutte Posted July 30, 2018 Share Posted July 30, 2018 For point 2: have you tried relative paths for the includes? If you copy always the same folder onto each computer, then the relative paths should still always be the same, shouldn't they? (Sorry, I cannot help for point 1) Quote Link to comment
Julian Carr Posted July 30, 2018 Author Share Posted July 30, 2018 Thanks for the suggestion Nicolas. Do you know if there is any documentation on how to create relative paths? Quote Link to comment
Nicolas Goutte Posted July 30, 2018 Share Posted July 30, 2018 (edited) I do know any, but it is not difficult, as the $INCLUDE notation does not change. You must just specify a relative path, instead of an absolute one. E.g., instead of using: {$INCLUDE c:\some\path\where\I\am\scripts\myscript.vss} just use: {$INCLUDE scripts\myscript.vss} Edited July 30, 2018 by Nicolas Goutte Quote Link to comment
Julian Carr Posted July 30, 2018 Author Share Posted July 30, 2018 Thanks again Nicolas. Unfortunately I can't get it to work. A full path such as this will work: {$INCLUDE /Users/juliancarr3/Desktop/MessageScriptTesting/MessageScript.vss } but then something like this (or variations thereof), does not work: {$INCLUDE /MessageScriptTesting/MessageScript.vss } The Vectorworks file with the saved views is also in the MessageScriptTesting folder. The following also doesn't work on the Mac which is unusual because I normally use backslashes in include names: {$INCLUDE \Users\juliancarr3\Desktop\MessageScriptTesting\MessageScript.vss } Quote Link to comment
Nicolas Goutte Posted July 30, 2018 Share Posted July 30, 2018 (edited) Your path should not start with / . A path starting with / means that it is absolute (The same with \ under Windows) As for your last example, I do not know if the space is allowed before } or if the space would count as if being part of the path. Edited July 30, 2018 by Nicolas Goutte Quote Link to comment
Julian Carr Posted July 30, 2018 Author Share Posted July 30, 2018 Thanks Nicolas. Yes I tried a few different combinations including this: {$INCLUDE MessageScriptTesting/MessageScript.vss} but none of them worked. Quote Link to comment
Nicolas Goutte Posted July 30, 2018 Share Posted July 30, 2018 Too bad. Unfortunately I have no idea for a work-around. Quote Link to comment
LarryO Posted August 25, 2018 Share Posted August 25, 2018 Do you not require a single period or double period before the slash. Single period representing the current directory and double period meaning go up one directory level. Also is the mac platform freed from activating Unix escape sequences (like \n ) when utilizing back slashes? You might need \\ to break the escape sequence. I'm no guru when it comes to Unix but I just read about this potentially being a problem when scripting. Of course one cannot span drives when using relative paths; only the active drive is accessible. Quote Link to comment
WhoCanDo Posted October 3, 2018 Share Posted October 3, 2018 A bit late but why don't you create a folder in the root directory to access. This should be the same path for every PC/user. Quote Link to comment
_c_ Posted October 3, 2018 Share Posted October 3, 2018 (edited) On 7/30/2018 at 11:42 AM, Julian Carr said: Thanks for the suggestion Nicolas. Do you know if there is any documentation on how to create relative paths? Julian, is this what you are looking for? {$INCLUDE ..\BlaBla.vss} --> go up 1 folder from current file location (= file containing the running script) . {$INCLUDE ..\..\BlaBla.vss} --> go up 2 folders from current file location {$INCLUDE ..\..\MyFolder\BlaBla.vss} --> go up 2 folders and enter MyFolder from current file location Edit: this is platform independent. Edited October 3, 2018 by _c_ removed extra character 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.