## Inject Script Action into Existing Menu: Possible?

intelligent machine
Fusionista
Posts: 403
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 29 times
Contact:

### Inject Script Action into Existing Menu: Possible?

Is it possible to write a config that will inject a new script action into an existing menu?
Say I want to add an "archive" or my "Incremental Save" script to the Fusion "File" menu in a specific place within that menu.

The menu entry in the .fu file looks something like this currently:

Code: Select all

	{
Target = "ChildFrame",

Before "Help"
{
{
"Incremental_Save{}",
"_",
"Branch{}",
"Merge{}",
"_",
"Archive{}",
},
},
},


I tried making "MyMenu" and just the menu items subs of "File" instead, but that doesn't work.
Any ideas?

SecondMan
Posts: 3416
Joined: Thu Jul 31, 2014 5:31 pm
Been thanked: 78 times
Contact:

### Re: Inject Script Action into Existing Menu: Possible?

Possible!

There are several Atoms in Reactor that make use of that functionality and can serve as an example. From the top of my head, Restart Fusion, Forum Utilities and nuke2fusion all do menu adding/adjusting.

Here's an example that adds an Incremental Save entry to the File menu:

Code: Select all

{
Action
{
ID = "Incremental_Save",
Category = "File",
Name = "Incremental Save",

Targets =
{
Composition =
{
Execute = [=[print("Saving a little bit more than before...")]=],
},
},
},
{
Target = "ChildFrame",

After "File\\Save Version"
{
"Incremental_Save{}",
},
},
}

For others here who don't know how to add this to Fusion, put the above in a .fu file (or download the attached file) and put it inside Fusion's Config:/ folder.

You do not have the required permissions to view the files attached to this post.

intelligent machine
Fusionista
Posts: 403
Joined: Fri May 13, 2016 10:01 pm