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

.importPublishProfileString resets Output filename

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

Views

159

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
no replies

Have something to add?

Join the conversation