Author Topic: How to auto load a macro on project load?  (Read 5662 times)

DanW

  • Community Member
  • Posts: 28
  • Hero Points: 2
How to auto load a macro on project load?
« on: August 25, 2006, 08:22:44 PM »
Is it possible to load a macro from somewhere other than under slickedit directory when a project is loaded.

We have Perforce here, and I would like to set it up so a macro is executed when a project is opened.
This way, when a developer loads a project, the project ENV variables are set based on the depot location
they loaded the project from.

Thanks.
Dan.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to auto load a macro on project load?
« Reply #1 on: August 27, 2006, 07:43:23 AM »
No problem - see this thread:
http://community.slickedit.com/index.php?topic=259.0

or use Slicks callback scheme.
Example to change to the project root dir:
Code: [Select]
void _prjopen_DanW ()
{
   // say ("_prjopen_DanW");
   _str cwd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));
   if ( cwd != '' )
   {
      cwd=absolute (cwd,strip_filename (_project_name,'n'));
      cd (cwd, 'm');
      // HS2: added to sync with 'Open' tab in project toolbar and process buffer
      _cd_tbopen ();
      _process_cd (cwd);
   }
}

HS2