Skip to main content
JoãoCésar17023019
Community Expert
Community Expert
August 14, 2017
Answered

Animate CC doesn't save changes made by a .jsfl script

  • August 14, 2017
  • 6 replies
  • 1843 views

Hi!

I wrote a simple .jsfl script to rename multiple Movie Clips in a grid. The script works and the instances are renamed the way I want.

But when I reopen the FLA the changes are gone.

Here is the script:

var selection = fl.getDocumentDOM().selection;

var i;

var total = selection.length;

var count = -1;

selection.reverse();

for (i = 0; i < total; i++)

{

     if (i % 16 == 0)

     {

          count++;

     }

     var xPos = i % 16;

     var yPos = count;

     selection.name = "tile" + xPos.toString() + "_" + yPos.toString();

}

Can someone tell me what is happening?

Thanks in advance!

This topic has been closed for replies.
Correct answer UDESCO

Thanks for sharing the video!

It seems the name changes were correctly getting saved if you're working on the main timeline. However, in your video you're working inside a Symbol - which is when the problem happens.

I'll log it as a bug internally.

6 replies

jimmy-mac
Participant
March 7, 2019

I've found that a lot of changes made with JSFL are dropped even after saving. This issue can't be replicated on a MAC. However, using the following snippet before saving the document seems to trick it into working... don't ask me why.

fl.getDocumentDOM().getTimeline().addNewLayer("_temp"); fl.getDocumentDOM().getTimeline().deleteLayer(fl.getDocumentDOM().getTimeline().findLayerIndex("_temp")[0]);

JoãoCésar17023019
Community Expert
Community Expert
August 17, 2017

Thank you, Nipun!

JoãoCésar17023019
Community Expert
Community Expert
August 16, 2017

Hi, Nipun. Thanks for your answer.

Here is a video showing what is happening:

First, I run the script without altering any other property. In this way the names are not kept when I reopen the FLA. Then, I run the script and alter the alpha property of all instances. In this way the names are kept when I reopen the FLA.

And here are the files so you can take a look: https://drive.google.com/drive/folders/0BxplDXBQ7gXzLUpCd3ZoaDNuWVU?usp=sharing

I tested in two FLA and the problem persisted.

Thank you!

UDESCO
UDESCOCorrect answer
Participating Frequently
August 17, 2017

Thanks for sharing the video!

It seems the name changes were correctly getting saved if you're working on the main timeline. However, in your video you're working inside a Symbol - which is when the problem happens.

I'll log it as a bug internally.

jimmy-mac
Participant
March 8, 2019

Sir, do you know the current status of this bug?

UDESCO
Participating Frequently
August 16, 2017

I tried running your JSFL script on a bunch of selected symbol instances on stage.

I then saved,closed and reopened the file and the name changes were present as expected.

Can you please specify how exactly to recreate the issue, if any? Please also share your test file, if it happens on a specific file only.

JoãoCésar17023019
Community Expert
Community Expert
August 16, 2017

Hi!

I tried changing another property of the Movie Clips (e.g. alpha) after renaming them and so the changes were saved.

But if I only change the names with the script, save the file and then reopen it, changes are gone.

This is a bug and I think it should be reported to Adobe.

Legend
August 14, 2017

Save the FLA before reopening it.

JoãoCésar17023019
Community Expert
Community Expert
August 14, 2017

Even saving the file changes are not retained.

Legend
August 14, 2017

Well, I just tested using JSFL to change the name of a moveclip, and it survived a save/load just fine.

Maybe try manually renaming a couple of movieclips before saving and see if those changes don't get saved either.