cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Assigning a macro to a toolbar button (Arbortext 5.4)

HelenOz
7-Bedrock

Assigning a macro to a toolbar button (Arbortext 5.4)

Can this be done?

I'm a keymapper-and-rememberer. A colleague is toolbar-clicker-and-keep-brain-uncluttereder. I have some macros I'd like to share as toolbar buttons. Can this be done? I've created a new toolbar by copying the file that defines the original ones to the custom/dialogs directory on Windows. However, I can't seem to find something to put in command= that will directly run one macro, as opposed to bringing up the dialog that lets you choose a macro to run.

Am I on the right track? What else do I need to do?

Or is there another way of mapping macros to new buttons in a new toolbar, that I should be using instead?

Thanks in advance

ACCEPTED SOLUTION

Accepted Solutions

Clay, Thanks. I'd figured most of this out. Where I got stuck was in not putting the macro definition in the proper file. There are two files that look rather similar, and one apparently overrides the other. I had it in the wrong one of the two. Once I moved my code to the proper file, it worked.

View solution in original post

2 REPLIES 2

Hi Helen--

You will want to use the "macro_run()" function to invoke your macro. For example, if your macro is called "FindGraphic", you would set up your toolbar button like so:

<button command="macro_run('FindGraphic')" id="toolbar_findgraphic" image="imgFindGraphic" tiptext="Find Next Graphic"></button>

Of course, for this to work on your friend's computer, you will need to copy your macro file over to his/her machine. The macro file is usually stored in you local app storage, on Windows 7 this will be something like

C:\Users\{username}\AppData\Roaming\PTC\Arbortext\Editor\user.mcf

If you copy your macro file to her machine, then she will have access to your macros, and the macro_run() function will be able to attach run them from a toolbar button. (Of course, if your friend has their own recorded macros, you'll want to do some kind of merge of the two user.mcf files, to add your macros to their file instead of just replacing the file.)

HTH

--Clay

Clay, Thanks. I'd figured most of this out. Where I got stuck was in not putting the macro definition in the proper file. There are two files that look rather similar, and one apparently overrides the other. I had it in the wrong one of the two. Once I moved my code to the proper file, it worked.

Announcements

Top Tags