Why getting doc path = building histogram?
Why getting doc path = building histogram?
When I try get active doc file path PS (CS2) says "Bulding histogram". It take a second or couple on big complex document. Is there a way to get rid of this "feature"?
Why getting doc path = building histogram?
Do this instead:
Code: Select allfunction getCurrentDocumentName() {
function cTID(s) { return app.charIDToTypeID(s); };
var ref = new ActionReference();
ref.putProperty(cTID('Prpr'), cTID('FilR'));
ref.putEnumerated(cTID('Dcmn'), cTID('Ordn'), cTID('Trgt'));
var desc = executeActionGet(ref);
return desc.hasKey(cTID('FilR')) ? desc.getPath(cTID('FilR')) : undefined;
};
Code: Select allfunction getCurrentDocumentName() {
function cTID(s) { return app.charIDToTypeID(s); };
var ref = new ActionReference();
ref.putProperty(cTID('Prpr'), cTID('FilR'));
ref.putEnumerated(cTID('Dcmn'), cTID('Ordn'), cTID('Trgt'));
var desc = executeActionGet(ref);
return desc.hasKey(cTID('FilR')) ? desc.getPath(cTID('FilR')) : undefined;
};
Why getting doc path = building histogram?
To add to Xbytor's post. I think what is happening it when you make a reference to a document using the DOM all the document properties need to be built. I do not know of anyway to avoid that using the DOM.
However you can also get most properties using Action Manger. Using that method allows you to only get the needed property. The function Xbytor posted uses the Action Manager.
However you can also get most properties using Action Manger. Using that method allows you to only get the needed property. The function Xbytor posted uses the Action Manager.