I’m sorry for my bad english. I have a question, I want to change the tab stops on the selected line to A) B) C) D) E), but if there are any graphics on this line, java code will delete this graphic. Thank you for every recommendation
The script I created from the code I found
app.findGrepPreferences = NothingEnum.nothing; // now empty the find what field!!! that’s important!!!
app.changeGrepPreferences = NothingEnum.nothing; // empties the change to field!!! that’s important!!!
// some settings
app.findChangeGrepOptions.includeFootnotes = false;
app.findChangeGrepOptions.includeHiddenLayers = false;
app.findChangeGrepOptions.includeLockedLayersForFind = false;
app.findChangeGrepOptions.includeLockedStoriesForFind = false;
app.findChangeGrepOptions.includeMasterPages = false;
var greps = [
{“findWhat”:”^.”,”changeTo”:”A) $0″},
{“findWhat”:”(?=.*$)”,”changeTo”:”$0B) “},
{“findWhat”:”.+?(?=.*$)”,”changeTo”:”$0C) “},
{“findWhat”:”.+?.+?(?=.*$)”,”changeTo”:”$0D) “},
{“findWhat”:”.+?.+?.+?(?=.*$)”,”changeTo”:”$0E) “},
]
// loop thru the greps object
for(var i = 0;i < greps.length;i++){
// this is like entering the find what text in the UI
app.findGrepPreferences.findWhat = greps[i].findWhat;
// this is like entering text in the change to
app.changeGrepPreferences.changeTo = greps[i].changeTo;
// and now hit the button
app.selection[0].changeGrep();
app.findGrepPreferences = NothingEnum.nothing; // now empty the find what field!!! that’s important!!!
app.changeGrepPreferences = NothingEnum.nothing; // empties the change to field!!! that’s important!!!
for example
line included
1 2 3 4 5
script change this line
A) 1 B) 2 C) 3 D) 4 E) 5