I dont know if this is progress, but With CS3 I do get doc ids back, and error numbers. I suppose it means my socket code is working properly. But CS3 doesn't have the exportPages function(). Ugh.
Are there any workarounds to get the current doc ids for the open documents in the application in CS5?
Also, In CS3:
fw.closeDocument('123456', False) doesn't work
doc.close('123456') seems to work
The docs are very inconsistent. Many of the properties for document are under the functions section. A few of the properties are actually billed as functions (doc.pageName is one), etc.
I am sure you would have read the Fireworks EULA.
Just to clarify, if you are using Fireworks on a server and interacting with the app via this channel, it is against the EULA.
The Fireworks APIs - dom.close() and fw.closeDocument() seems to be working fine, both on Fw CS3 and CS5.
You could try using the following code:
var dom=fw.getDocumentDOM(); //Gets the document object of the current document.
var mydoc=fw.documents; // Get the document object of the first document that is open.
fw.closeDocument(mydoc,false); //closes the document.
You can use "fw.closeDocument(dom,false);" to close the current document.
“dom.close(true);” or “mydoc.close(true);” can also be used to close the document.
fw.documents is an array of Fireworks documents that are currently open in Fireworks.
You can use fw.documents[i] to perform operations on the ith document.
Hi Priyanka. It seems you are using the JS api? Flash? I am trying to use this via the XML RPC server in fireworks. Those are precisely the calls I am making to the RPC server with no avail: they do not return document ids. If you get a chance, can you (or anyone) run the following python code? Just open fireworks CS5, open a file and run this python code. It should return (print) the document id of the current document in a value="" attribute.
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost", 12124)) dom = '<func name="getDocumentDOM" obj="fw"><string order="0" value="document" /></func>\0' s.send(dom) res =  r = s.recv(1) while ord(r): res.append(r) r = s.recv(1) print ''.join(res)
Like I said earlier, this code works for me with CS3, but does not work with CS5; value="" is empty.
I am not running this on a server. I am just trying to do some batch processing.
I noticed that this object ID problem occurs when I run this code on a Mac but it works fine on Windows 7. I'm running the exact same code but for Fireworks CS6. On Mac I get:
<return><obj value="" class="DocumentClass"></obj></return>
but on Windows the value is the proper ID number.
So far on the mac NONE of the return objects have a proper value unless the object is of type string. FwArray, DocumentClass, et cetera all have "" for value.
On Windows there is no problem and the code hasn't changed.
Is it possible to notify Adobe about this potential bug? Or has anyone discovered a work-around to get the DocumentClass object ID??