Relative Path for script in the Extension manager bar

FaForno
FaForno Altair Community Member
edited March 5 in Community Q&A

Good afternoon All,

To share inside my team the new company bar, I want to use OneDrive (it allow me to manage directly the team and the access in a controlled way).

Using this tool will be easy to control the routine used by the full Global Team and this will simplify a lot my life.

Now, to declare the routine, in xml file, I’m using the following:

                command="tcl: source C:/Users/USER1/OneDrive\ -\ Maxion/MaxionMacroUtilities/hm/Script/01_MyStart_rev04.tbc"

but, once shared with one drive, instead of USER1 they will have their own company user (USER2, USER3 ….).

To tourn around that I was thinking to use the relative path, like this:

               command="tcl: source ../MaxionMacroUtilities/hm/Script/01_MyStart_rev04.tbc"

but it doesn’t work.

 

Do you have any idea to extract the path or to make it sharable with OneDrive?

(I think this is something of interest from many users).

 

Thanks a lot in advance and best regards,

Fabio

Answers

  • AndreasAltmann
    AndreasAltmann Altair Community Member
    edited March 5

    Hello FaForno,

    we are working with environment variables to share our scripts worldwide.
    In your case you might use $::env(ONEDRIVE) - at least in my system the variable points to my onedrive folder.

    command="tcl: source $::env(ONEDRIVE)/MaxionMacroUtilities/hm/Script/01_MyStart_rev04.tbc"

    Or every user need to create an environement variable, which points to their onedrive

    exec setx ONEDRIVE_PATH [file normalize C:/Users/USER1/OneDrive]
    command="tcl: source $::env(ONEDRIVE_PATH)/MaxionMacroUtilities/hm/Script/01_MyStart_rev04.tbc"

     

    BR

    Andreas