Why getting doc path = building histogram?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

kostyanet

Why getting doc path = building histogram?

Post by kostyanet »

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"?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

xbytor

Why getting doc path = building histogram?

Post by xbytor »

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;
};
Mike Hale

Why getting doc path = building histogram?

Post by Mike Hale »

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.