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

Publish all open files using JSFL script problem

Community Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

Hi, I'm trying to get a jsfl script to run in Animate 23.0.2 through Run Command... that will publish all open files. The script I'm using is below. My problem is that it only will publish the open tab file, but it does it in every open file's directory. So, I end up with one file's published files in all the directories. 

function export_all(){ 
    var docs=an.documents;
    var docs_length=docs.length;
    for (var i=0; i<docs_length; i++) {  
        var doc = docs[i];
        doc.publish();
    }
}

export_all();

Views

358

Translate

Translate

Report

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 , Sep 29, 2023 Sep 29, 2023

It's not an ideal solution, but it worked for both AS3 and HTML5 Canvas documents.

 

var docs = fl.documents;
var docIndex, doc;

for (docIndex in docs)
{
	doc = docs[docIndex];
	fl.setActiveWindow(doc);
	doc.publish();
}

Votes

Translate

Translate
Community Expert ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

try:

 

for (doc in fl.documents) {
fl.documents[doc].publish();
}

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

Thanks for the reply. I tried your solution and it has the same behavior as the script I posted, it publishes only the current tab document to all the open document's directories.

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

not for me.  all fla's open in animate publish.

 

create a new directory 

save your jsfl to that new directory with a new name.

retest.

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

Hi.

 

Both scripts work for me.

 

Can you provide more details?

 

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

Yes, I made some new test files and placed them in new directories. I renamed the JSFL and put that in a new directory. I'm running macOS Ventura and Animate 23.0.2.
I took some screen shots.

Directories before running the JSFL script:

 

Screenshot 2023-09-29 at 12.31.28 PM.png

Animate with files open. Banner_File_1.fla being the current tab.

Screenshot 2023-09-29 at 12.32.17 PM.png

Directories after running the JSFL:

Screenshot 2023-09-29 at 12.32.51 PM.png

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

@Todd31479318hnlq 

 

so, is there a problem?

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

It really fails when the document type is HTML5 Canvas.

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

Oh, I see. So, it just won't work for publishing HTML5 Canvas?

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

that's a bug.  all the canvas doc's are published with the same name.

 

 

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

I do not want to mix all my image files in the same image directory. My files (hundreds of them) all have the same naming structure, they would just overwrite one another.

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

that was my error. using the same directory for all the fla's doesn't prevent the name problem/bug.

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

It's not just the name that is is the same, They are actually all the same file being published. Thes files all have different dimensions and all the published files are the one file's dimension with that file's related image assets. 

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

understood.  that's a bug.

 

to report bugs or ideas or wishes to adobe:

 

for applicable apps, use https://helpx.adobe.com/ie/x-productkb/global/how-to-user-voice.html

 

for others, use https://www.adobe.com/products/wishform.html

 

if neither show a place to report the issue, just leave it here.  that's the best you can do.

Votes

Translate

Translate

Report

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 ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

It's not an ideal solution, but it worked for both AS3 and HTML5 Canvas documents.

 

var docs = fl.documents;
var docIndex, doc;

for (docIndex in docs)
{
	doc = docs[docIndex];
	fl.setActiveWindow(doc);
	doc.publish();
}

Votes

Translate

Translate

Report

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 Beginner ,
Sep 29, 2023 Sep 29, 2023

Copy link to clipboard

Copied

LATEST

Yes, one of my team just came up with a similar solution:

 

 

for (var i = 0; i < fl.documents.length; i++) {

    an.setActiveWindow(fl.documents[i]);

    an.getDocumentDOM().publish();

}

 

Thank you for your help.

Votes

Translate

Translate

Report

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