This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Production steps of ECMA-262, Edition 5.1, 15.4.4.20 | |
| // https://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.20 | |
| // from http://javascript.boxsheep.com/polyfills/Array-prototype-filter/ | |
| if (!Array.prototype.filter) { | |
| Array.prototype.filter = function(callbackfn , thisArg) { | |
| "use strict"; | |
| var O = Object(this), | |
| lenValue = O.length, | |
| len = lenValue >>> 0, | |
| T, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function prompt (mes){ | |
| var string = Browser.inputBox(mes); | |
| return string; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function confirm (mes){ | |
| var res = Browser.msgBox(mes, Browser.Buttons.OK_CANCEL); | |
| if (res === "ok"){ | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #target "indesign" | |
| if (app.documents.length == 0) myerror("ドキュメントが開かれていません"); | |
| if (app.selection.length == 0) myerror("何も選択されていません"); | |
| if (7 > parseInt(app.version)) myerror("InDesignが対応バージョンではありません"); | |
| var myDoc = app.activeDocument; | |
| var mySel = myDoc.selection; | |
| if (mySel.length > 1) myerror("2つ以上選択しないでください"); | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getOtherSheetsValue() { | |
| var myObj = {}; | |
| //現在のスプレッドシート情報 | |
| myObj.doc = SpreadsheetApp.getActiveSpreadsheet(); | |
| myObj.sheet = myObj.doc.getSheetByName("シート1"); | |
| myObj.range = myObj.sheet.getDataRange(); | |
| myObj.values = myObj.range.getValues(); | |
| //IDを記述したセルからコンテンツを取得 | |
| var tgID = [ | |
| myObj.values[0][0], //A1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //セット名が重複しても上書きされずにそのまま追加されます | |
| var costomCharSet = { | |
| name: "セット名", //特例文字セット名 | |
| customCharacters: "%◯&", //追加する文字 | |
| appliedFont: "A-OTF 見出ゴMB31 Pr6", //フォント | |
| fontStyle: "MB31" //スタイル・ウェイト | |
| }; | |
| !function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !function() { | |
| var doc = app.activeDocument; | |
| var compFonts = doc.compositeFonts; | |
| for (var i=compFonts.length-1; i>0; i--) { | |
| if (/\-\d+$/.test(compFonts[i].name)) { | |
| compFonts[i].remove(); | |
| } | |
| } | |
| }(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !function() { | |
| var doc = app.activeDocument; | |
| var compFont = doc.compositeFonts[1]; //0だと[No composite font]になる | |
| var cfEnt = compFont.compositeFontEntries; | |
| var result = []; | |
| for (var i=1; i<cfEnt.length; i++) { //漢字は取得できないのでi=1から | |
| result.push("【" + cfEnt[i].name + "】"); | |
| result.push(cfEnt[i].customCharacters); | |
| } | |
| makeTxtFile(result.join("\n"), "~/desktop/"+compFont.name+".txt"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function insertInitSpace() { | |
| var doc = DocumentApp.getActiveDocument(); | |
| var paras = doc.getBody().getParagraphs(); | |
| paras.forEach(function (cv) { | |
| var fl = cv.getIndentFirstLine(); | |
| if (fl > 0) { | |
| cv.setIndentFirstLine(0); | |
| cv.setText(" "+cv.getText()); | |
| } | |
| }); |
OlderNewer