I would like to write some commands related to sharing pages. I wrote a simple command that lets me share a layer to the next page. This is nice but I'm stymied taking it further. For example, one thing that I can't figure out is
I noticed in the history that there are two undocumeted API calls - excludeSharedLayer & detachSharedLayer. For example
fw.getDocumentDOM().detachSharedLayer(2, 11);. The arguments for this method are not apparent. The first is the layer number that is being detached but the second is not apparent. It doesn't make much sense to run these on a layer that isn't shared and in fact this brings an error so it is problematic.
In the short term, I'd like to know if there are any properties or methods to detect if a layer is Page shared and ideally to what other pages it is shared. Longer term, I hope that Adobe could update the FWAPI document to be more thorough because the presence of undocumented API methods and properties is frustrating.
I figured out that the arguments are layer number and page number. So, I was able to write fw.getDocumentDOM().detachSharedLayer(fw.getDocumentDOM().currentLayerNum, fw.getDocumentDOM().currentPageNum);
But still, if the layer is not shared, I get an exception. I'd still like a way to check if the layer is shared before trying to detatch or exclude it.
The .detachSharedLayer() function is documented here: http://help.adobe.com/en_US/fireworks/cs/extend/WS5b3ccc516d4fbf351e63e3d1183c94856c-7808. html
But I don't know about excludeSharedLayer. There seem to be a lot of page methods that aren't documented. The pages API is pretty crap, unfortunately, so there may not be a way to tell whether a layer is shared across pages. You may just need to wrap the call in a try/catch and ignore the exception when you try to detach a non-shared layer. I don't seem to get an exception when I try to do that, though.
I've collected some bugs and undocumented functions here: https://github.com/fwextensions/fwjs-errata I'll have to add excludeSharedLayer, and the other page methods.