Untitled

 avatar
unknown
javascript
9 months ago
1.1 kB
13
No Index
// https://x.com/cooldtp/status/1938429684813074885
// https://community.adobe.com/t5/indesign-discussions/issue-with-setting-createprimarytextframe-in-a-documentpreset/m-p/15384083
var cPTF = app.documentPreferences.createPrimaryTextFrame;
if (app.documentPreferences.createPrimaryTextFrame) {
    // 
    var dp = app.documentPresets.itemByName("cPTF_True")
    if (!dp.isValid) {
        dp = app.documentPresets.add({
            name: "cPTF_True"
        })
    }
} else {
    // 
    var dp = app.documentPresets.itemByName("cPTF_False")
    if (!dp.isValid) {
        dp = app.documentPresets.add({
            name: "cPTF_False"
        })
    }
}
// 
app.documentPreferences.createPrimaryTextFrame = true;
var dp = app.documentPresets.itemByName("cPTF_SetTrue")
if (!dp.isValid) {
    dp = app.documentPresets.add({
        name: "cPTF_SetTrue"
    })
}
// 
app.documentPreferences.createPrimaryTextFrame = false;
var dp = app.documentPresets.itemByName("cPTF_SetFalse")
if (!dp.isValid) {
    dp = app.documentPresets.add({
        name: "cPTF_SetFalse"
    })
}
app.documentPreferences.createPrimaryTextFrame = cPTF;
Editor is loading...
Leave a Comment