This content has been marked as final. Show 3 replies
I'm trying to get to the bottom of this, and after my loop of load-copy-paste of all my individual graphics into my main document, I tried to call fw.getDocumentDOM() again, and that call throws an error code of '-2147216341'.
So, if copy-n-paste from one document to another (and then closing the one document) leaves FW in a state of 'I dont know what document im focused on', I think the question I need to ask is how do I tell FW to focus back on my original document? It must be hiding in the online docs somewhere...!
Well for those of you interested, it seems doc.moveSelectionToLayer() will move layers around. (Thanks to the 'Arrange Commands' at Senocular.com).
If there's anyone at Adobe who watches these forums, can I suggest that the APIs need changing so that the Layer object should contain its index (ie UID). If you write a function to find a layer by a pseudo path using 'doc.topLayers' then I can't find a reliable way to relate that back to an index in 'doc.layers'.
I would still really appreciate any help on why I get exceptions when I open-n-cut-n-paste-n-close. *please!*
Well it looks like what I really needed was doc.importFile().
Many thanks to John Dunning for hosting a scripts ('Page Commands') that used this. It's in the FW documentation, but I obviously overlooked it. However, its funny (and reasuring) John was also having the same problem when using an alternate doc after calling doc.close().