Copy link to clipboard
Copied
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!
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.
Copy link to clipboard
Copied
Save the FLA before reopening it.
Copy link to clipboard
Copied
Even saving the file changes are not retained.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Sir, do you know the current status of this bug?
Copy link to clipboard
Copied
As far as I know it's related to some kind of 'fast-save optimization'.
You may increase your chance to get changes saved if you open the Modify menu, choose Document... and just click OK.
This will generate a Modify FLA Document entry in history which is likely to force Save to go through the whole file and save all changes.
My memory is a little vague at the moment, but I think they introduced this in CS5 or CS4. It's definitely present in CS6.
(Obviously a poorly implemented feature.)
If you just do Save As and give it a new name most likely changes will not be saved. It is a very persistent 'feature'.
The safest way to tackle this might be to copy / paste all your stuff into a new file and save that new file; then close, then open and check.
Have fun!
Copy link to clipboard
Copied
Thank you, Nipun!
Copy link to clipboard
Copied
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]);