-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchangeMainPage.jsx
50 lines (41 loc) · 1.36 KB
/
changeMainPage.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
main();
myNoTextTextFrames();
function main(){
var myText=app.findGrep();
for (var i=0; i<myText.length;i++)
{
try{
myText[i].parentTextFrames[0].parentPage.appliedMaster=NothingEnum.NOTHING;
}catch(err)
{
//在这里处理错误
alert(err);
}
// myText[i].parentTextFrames[0].nextTextFrame.parentPage.appliedMaster=NothingEnum.NOTHING;
//跨页的操作
// myText[i].parentTextFrames[0].nextTextFrame.parentPage.parent.appliedMaster=NothingEnum.NOTHING;
}
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findChangeGrepOptions.includeFootnotes = false;
app.findChangeGrepOptions.includeHiddenLayers = false;
app.findChangeGrepOptions.includeLockedLayersForFind = false;
app.findChangeGrepOptions.includeLockedStoriesForFind = false;
app.findChangeGrepOptions.includeMasterPages = false;
}
function myNoTextTextFrames(){
var myDoc=app.activeDocument;
var myTextFrames=myDoc.textFrames;
for (var x=0;x<myTextFrames.length;x++){
if (myTextFrames[x].contents.length<1){
// alert(myTextFrames[x].contents.length);
try{
myTextFrames[x].parentPage.appliedMaster=NothingEnum.NOTHING;
}catch(err)
{
//在这里处理错误
alert(err);
}
}
}
}