#targetengine "CopipeCheck" function addEL(obj, eventName, handler, name) { var el0 = obj.eventListeners.item(name); if (el0.isValid) el0.remove(); obj.addEventListener(eventName, handler).name = name; } addEL(app.menuActions.itemByID(119698), "beforeInvoke", function (ev){ var sel0=app.selection[0]; if (sel0 && sel0.hasOwnProperty("paragraphs") && sel0.paragraphs.length>1){ ev.preventDefault(); app.doScript(function(){ var paras=sel0.paragraphs.everyItem().getElements(); for (var i=paras.length-1;i>=0;i--) paras[i].insertionPoints[0].contents="\t"; },ScriptLanguage.JAVASCRIPT,[],UndoModes.ENTIRE_SCRIPT); } }, "Tab1"); addEL(app.menuActions.itemByID(119673), "beforeInvoke", function (ev){ var sel0=app.selection[0]; if (sel0 && sel0.hasOwnProperty("paragraphs") && sel0.paragraphs.length>1){ ev.preventDefault(); app.doScript(function(){ var paras=sel0.paragraphs.everyItem().getElements(); for (var i=paras.length-1;i>=0;i--) { var c0=paras[i].characters[0]; if (c0.contents=="\t") c0.contents=""; } },ScriptLanguage.JAVASCRIPT,[],UndoModes.ENTIRE_SCRIPT); } }, "ShiftTab1");
プロフィール
最近の記事