We have added the activeDocument field to the application module. By using this field, application.activeDocument, you are able to access user’s currently activated document’s name and guid. Please see examples in the docs.
Fantastic! Now, please add application.pid that gives the process ID, and application.startTime and I’ll be deliriously happy.
Use case
When building almost any kind of plugin licensing scheme, and checking in with a license server, we’d need to know how many different active XD sessions are trying to use the license.
Supplying the application.pid + '/' + application.startTime would give a solidly unique session id that we could depend on. (The chance of multiple XD applications having the same .pid and .startTime is ridiculously small.)
Otherwise, since plugins are essentially run per-document, if someone opened 3 documents, and the plugin checked in at its startup, it would look the same as if 3 users opened one document.