Author Topic: Workspace specific macros  (Read 4328 times)

Chris Nisbet

  • Community Member
  • Posts: 26
  • Hero Points: 2
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: 2796
  • Hero Points: 347
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: 2761
  • Hero Points: 292
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: 26
  • Hero Points: 2
Re: Workspace specific macros
« Reply #3 on: December 26, 2015, 04:52:00 PM »
Thanks.