Skip to main content
Willi_Lopes
Known Participant
July 14, 2023
Answered

Create a shortcut with two actions

  • July 14, 2023
  • 1 reply
  • 2320 views

Hello everyone, it is possible to create a shortcut that has these two actions, "expand folder and lock the other layers", I created these shortcuts but separated and I already tried to use the history but it didn't work.

In the two prints I exemplified

This topic has been closed for replies.
Correct answer JoãoCésar17023019

This two steps on print:


Please save the code below in a .jsfl file and test it. If it works, you can place this file in the commands folder and assign a shortcut to it.

 

var dom = fl.getDocumentDOM();
var tl = dom.getTimeline();
var currentLayerIndex = tl.currentLayer;
var currentLayer = tl.layers[currentLayerIndex];

if (currentLayer.layerType === "folder")
{
	tl.expandFolder(true);
	tl.setLayerProperty("locked", true, "all");
	tl.setLayerProperty("locked", false);
}

1 reply

JoãoCésar17023019
Community Expert
Community Expert
July 14, 2023

Hi.

 

You can save steps in the History panel as a command and assign a shortcut to the command.

 

If the sequence of steps is complex, you'll have to code a JSFL manually.

 

Please let us know if you need more details on how to follow these approaches.

 

Regards,

JC

kglad
Community Expert
Community Expert
July 14, 2023

@JoãoCésar17023019 

 

(steps marked with a red x can't be saved as a command.)

JoãoCésar17023019
Community Expert
Community Expert
July 14, 2023

Yeah, I know.

 

That screenshot was just a very quick example.