Author Topic: Workspace specific macros  (Read 1602 times)

Chris Nisbet

  • Community Member
  • Posts: 16
  • Hero Points: 0
Workspace specific macros
« on: December 26, 2015, 03:03:16 am »
Hi
Is it possible to set up macros that are only executed when a specific workspace is loaded? As an example, I would like to execute a command whenever a file is saved, but only in one workspace. In other workspaces, I would like to execute a different command, or no command at all. I have made a macro to execute this command when a file is saved, but it currently executes no matter which workspace is open.
I did have a look through this forum but wasn't able to find any mention of workspace specific macros.
Thanks in advance for any assistance.

Graeme

  • Senior Community Member
  • Posts: 2091
  • Hero Points: 252
Re: Workspace specific macros
« Reply #1 on: December 26, 2015, 09:23:52 am »
Have a look at this
https://community.slickedit.com/index.php?topic=9690.msg41443#msg41443

You can check the value of _workspace_filename in your macro.
You might also be able to set the value of an environment variable in your workspace properties and check the value using get_env in a macro - I'm not sure how that works though.

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Workspace specific macros
« Reply #2 on: December 26, 2015, 09:47:16 am »
And you can setup per project (open) macros in Project>Properties.
HS2

Chris Nisbet

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Workspace specific macros
« Reply #3 on: December 26, 2015, 04:52:00 pm »
Thanks.