Author Topic: Really simple beginning question...  (Read 2323 times)

pbreed

  • New Community Member
  • Posts: 2
  • Hero Points: 0
Really simple beginning question...
« on: June 30, 2023, 12:28:25 AM »
I'm really struggling to get macros to work....

If have a file mymacro.e
What do I have to do so it automatically loads every time slickedit runs?
How do I bind a key to it?

I could not get that to work so I thought I'd just modify one of the existing macros in the installed macro directory...
Nothing I do there seems to modify the behavior I expect?

The directory is by default readonly...

So I copy the .e file say briefutl.e
to another directory...
Change the text of a message buried in there...
st the file in the new directory getting breifutl.ex

then using admin privileges copy that back into the macro directory... the message text is unchanged?

I don't understand?








Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2902
  • Hero Points: 153
Re: Really simple beginning question...
« Reply #1 on: June 30, 2023, 01:40:24 AM »
I'm really struggling to get macros to work....

If have a file mymacro.e
What do I have to do so it automatically loads every time slickedit runs?
How do I bind a key to it?

If it is not a batch macro (does not have a defmain), once it is loaded, it should remain loaded.

Is it a batch macro?

Graeme

  • Senior Community Member
  • Posts: 2801
  • Hero Points: 347
Re: Really simple beginning question...
« Reply #2 on: July 01, 2023, 07:26:07 AM »
Do you have the pro version or standard version of slick?  There are some differences regarding macros.

The st command compiles but doesn't load a macro file.  Replacing an .ex file in the macros folder will have no effect because loaded macro .ex files are bound into the state file (vslick.sta) in your configuration folder and the .ex file itself is ignored.  Slickedit doesn't care what folder a macro source file is located in - all macro source files must have a globally unique name.  If you copy briefutl.ex to a new folder and load it using the load module command in the macro menu, it will replace the existing briefutl in the state file.  If a hotfix involving briefutl.e comes along, it will replace your version of briefutl.ex.  When slickedit starts, if there is no state file, it will probably try to build a new one using the .ex files.

Try recording a macro, then bind a key to it.  Recorded macros are stored in vusrmacs.e in your configuration folder and are loaded into your state file.  If you have a definit function in your macro file, the definit will be executed when slickedit starts.
« Last Edit: July 02, 2023, 05:17:21 AM by Graeme »