Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create a shortcut with two actions

Participant ,
Jul 14, 2023 Jul 14, 2023

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

TOPICS
Code , How to
881
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 14, 2023 Jul 14, 2023

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);
}
Translate
Community Expert ,
Jul 14, 2023 Jul 14, 2023

Hi.

 

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

image.png

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 14, 2023 Jul 14, 2023

Olá João,

I need these two actions to be in the same shortcut, I tried saving the action and converting it to the command, but it didn't work. I don't have that knowledge in JSFL.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2023 Jul 14, 2023

What steps of the History were you using separately?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 14, 2023 Jul 14, 2023

This two steps on print:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2023 Jul 14, 2023

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);
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 14, 2023 Jul 14, 2023

That it's!! Perfect! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 14, 2023 Jul 14, 2023
LATEST

Obrigado João! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2023 Jul 14, 2023

@JoãoCésar 

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2023 Jul 14, 2023

Yeah, I know.

 

That screenshot was just a very quick example.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 14, 2023 Jul 14, 2023

ok

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines