macro to find current project

macro to find current project

11
Basic UserBasic User
11

    Feb 04, 2007#1

    howdy all --

    Has anyone figured out a way to return the name of the current project, & the root/base directory of the current project from running a macro?

    I'd like to get both of those variables saved onto a couple of the clipboards for use with other "auto save" macros.

    Would nice to have a variable [ThisProjectPath] or [ThisProjectName] that was useable from a template, but I don't see any references to it or how to get them from a macro in the forum. ( Usually when I create new files for a project from a template, the files are not saved with a name yet, so the [FILE_PATH] var always returns empty when UE generates them.)

    Any ideas how to find this info out on the fly via a macro? BTW, Im using v12.20a.

    Tnx,
    Wz

    6,603548
    Grand MasterGrand Master
    6,603548

      Feb 04, 2007#2

      I have only one idea how to get those infos. You must create a user tool which has for example the command line:

      echo Project file=%r Project directory=%rp Project name=%rn

      This user tool is a Dos Program. Activate also Capture Output and select Create New File. Depending on your Windows version you maybe need also Show DOS Box checked.

      Give the user tool an appropriate name like "Get Project Variables".

      Now you can run this tool from within a macro with the command

      RunTool "Get Project Variables"

      and the result is always a new file which contains the wanted infos which can be now extracted by your macro and used accordingly.

      Please note: Project directory= is not 100% correct. 100% correct would be Path of project file=. It is possible to specify in the project settings a project directory which is not identical with the directory where the project file is stored. If you use that, you must open the project file with the macro and extract the real project directory directly from the project file.
      Best regards from an UC/UE/UES for Windows user from Austria

      11
      Basic UserBasic User
      11

        Feb 04, 2007#3

        wow, tnx Mofi.

        sweet. better than a wet dream. :lol:

        (still need user defined variables within the macros though, to make life truly easy)

        As always, tnx a million for sharing your knowledge. UE wouldnt be such an accessable tool without ya.


        Wz