Highlighted

.importPublishProfileString resets Output filename

Community Beginner ,
Jan 11, 2019

Copy link to clipboard

Copied

I'm trying to modify publish settings via XML edits (jsfl), but I'm having some issues with Output (filename) settings resetting to the FLA filename when I re-import the XML.

If I have a Test.fla :

var dom = fl.getDocumentDOM();

var profileXML = dom.exportPublishProfileString('SVG');

var outName = "Test_001.svg";

// replace all "filename" properties

profileXML = profileXML.replace(/<Property name="filename">.+?<\/Property>/g, '<Property name="filename">'+outName+'</Property>'); 

// reimport

dom.importPublishProfileString(profileXML)

profileXML traces correctly, with instances of: <Property name="filename">Test_001.svg</Property>

However, the Output name in Publish Settings has reverted to the Test (the name of the FLA file), and fl.Publish() outputs as Test.svg

You'll note I'm exporting as SVG, and SVG Image is already set up in the settings. The only thing I need to alter on Publish() is the output name.

Is there any simple (or better) way around this?

Animate CC 18.0.2 Build 126

Cheers

Message was edited by: adamlt, subject title clarity

TOPICS
Discussions

Views

92

Likes

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

.importPublishProfileString resets Output filename

Community Beginner ,
Jan 11, 2019

Copy link to clipboard

Copied

I'm trying to modify publish settings via XML edits (jsfl), but I'm having some issues with Output (filename) settings resetting to the FLA filename when I re-import the XML.

If I have a Test.fla :

var dom = fl.getDocumentDOM();

var profileXML = dom.exportPublishProfileString('SVG');

var outName = "Test_001.svg";

// replace all "filename" properties

profileXML = profileXML.replace(/<Property name="filename">.+?<\/Property>/g, '<Property name="filename">'+outName+'</Property>'); 

// reimport

dom.importPublishProfileString(profileXML)

profileXML traces correctly, with instances of: <Property name="filename">Test_001.svg</Property>

However, the Output name in Publish Settings has reverted to the Test (the name of the FLA file), and fl.Publish() outputs as Test.svg

You'll note I'm exporting as SVG, and SVG Image is already set up in the settings. The only thing I need to alter on Publish() is the output name.

Is there any simple (or better) way around this?

Animate CC 18.0.2 Build 126

Cheers

Message was edited by: adamlt, subject title clarity

TOPICS
Discussions

Views

93

Likes

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
Jan 11, 2019 0

Have something to add?

Join the conversation