Skip to main content
Participating Frequently
September 19, 2021
Question

Change output location for canvas doc via JSFL

  • September 19, 2021
  • 1 reply
  • 150 views

Hi all,

 

Is there a way to change the output/publish location of a HTML canvas doc via JSFL script? I've tried exporting the publish profile and changing the filename but no go so far. Wondering if there is something I'm missing or a better way?

 

Cheers

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    September 20, 2021

    Hi.

     

    What happens when you import back the modified profile?

     

    Regards,

    JC

    ZyncAuthor
    Participating Frequently
    September 20, 2021

    I'm doing this:

     

    var newProfileXML;
            var profileXML= fl.getDocumentDOM().exportPublishProfileString(); 
            newProfileXML = profileXML.replace(/<Property name="filename">.+?<\/Property>/g, '<Property name="filename">'+distFolder+'.'+'</Property>');
            newProfileXML = profileXML.replace(/<Property name="SiteUrl">.+?<\/Property>/g, '<Property name="SiteUrl">'+distFolder+'.'+'</Property>');
            fl.trace(newProfileXML);
            doc.importPublishProfileString(newProfileXML);
    
            doc.publish();

    . But it's just exporting to the same folder as teh fla instead of the output folder I've specified.