示例#1
0
    private void LoadToolPresets(string toolsPath)
    {
        ActionDescriptor actionDesc = new ActionDescriptor();
        ActionReference  actionRef  = new ActionReference();
        int idsetd       = psApp.CharIDToTypeID("setd");
        int idnull       = psApp.CharIDToTypeID("null");
        int idPrpr       = psApp.CharIDToTypeID("Prpr");
        int idtoolPreset = psApp.StringIDToTypeID("toolPreset");

        actionRef.PutProperty(idPrpr, idtoolPreset);
        int idcapp = psApp.CharIDToTypeID("capp");
        int idOrdn = psApp.CharIDToTypeID("Ordn");
        int idTrgt = psApp.CharIDToTypeID("Trgt");

        actionRef.PutEnumerated(idcapp, idOrdn, idTrgt);
        actionDesc.PutReference(idnull, actionRef);
        int idT = psApp.CharIDToTypeID("T   ");

        actionDesc.PutPath(idT, toolsPath);
        int idAppe = psApp.CharIDToTypeID("Appe");

        actionDesc.PutBoolean(idAppe, true);
        psApp.ExecuteAction(idsetd, actionDesc, PsDialogModes.psDisplayNoDialogs);
    }