Author Topic: Scripting, get the path of the currently active project  (Read 4737 times)

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Scripting, get the path of the currently active project
« on: April 09, 2008, 04:26:17 pm »
Hi,

I'm trying to write a script to generate doxygen dokumentation for my projects. I need to know, how to figure out the path of the actually activated project in my workspace. Please, have the kindness to help me
 

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Scripting, get the path of the currently active project
« Reply #1 on: April 09, 2008, 04:47:21 pm »
Code
GetProjectManager().GetActiveProject().GetCommonTopLevelPath();

Also refer-

Quote
http://wiki.codeblocks.org/index.php?title=Scripting_commands
Be a part of the solution, not a part of the problem.

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: Scripting, get the path of the currently active project
« Reply #2 on: April 09, 2008, 07:01:02 pm »
Code
GetProjectManager().GetActiveProject().GetCommonTopLevelPath();

Quote
http://wiki.codeblocks.org/index.php?title=Scripting_commands

Many thanks for responding!
Unfortunately, your tip doesnt work. Before posting this message, I investigated your wikipages and had an additionally  look to the scripts in the codeblocks script directory and found, what you told me.

There are five projects in my workspace. I activated every project one by one and typed print( GetProjectManager().GetActiveProject().GetCommonTopLevelPath()); in your Script console. After that I had correct results for three of them. Two failed, I got the parentpath of the project.

Both named projects are using files, wich are stored above the project directory. So, the GetCommonTopLevelPath() will (correctly) return the highest point in the whole path. The codeblocks script make_dist.script from Yiannis struggles with the same problem.

After thinking about the problem, it would be better to have a list about all the files in the current activated project. This way I can write a doxygen config file and simply execute this.

Do you have any other suggestions?



« Last Edit: April 09, 2008, 07:35:34 pm by jomeggs »