2012
08.26

If you use pages in fireworks when export slices, you want to hide master page from all pages.
This command toggle the visibility of the master page.

changeVisibleMasterPage.jsf

jsf code:

try {
    if (fw.documents.length != 0) {
        var dom = fw.getDocumentDOM();
        if (!fw.getDocumentDOM().isMasterPageLayer(0)) {
            alert("This page isn't contain master page layer.")
        } else {
            var pName = "com.yoropan.isMasterPageVisible"
            var isMasterVisible;
            if (fw.getPref(pName)) {
                isMasterVisible = fw.getPref(pName);
            } else {

                isMasterVisible = false;
            }

            var pno = dom.currentPageNum;
            dom.changeCurrentPage(0);

            dom = fw.getDocumentDOM();
            var j = fw.getDocumentDOM().layers.length;
            for (i = j; i--;) {
                dom.setLayerVisible(i, -1, isMasterVisible, false);
            }
            fw.getDocumentDOM().changeCurrentPage(pno);
        }
        
        fw.setPref(pName, !isMasterVisible)
    } else {
        alert("No documents")
    }
} catch (e) {
    alert(e)
}

No Comment.

Add Your Comment

%d人のブロガーが「いいね」をつけました。