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
| /** | |
| * ClipMenu用スクリプト | |
| * gist-itのパス表現はここを参照した | |
| * http://ryoichi0102.hatenablog.com/entry/2015/11/13/091803 | |
| * 適当に書き換えて使ってください | |
| */ | |
| clipText = clipText.trim(); | |
| var myPath = clipText.split("/"); | |
| var txt = '<script src="http://gist-it.appspot.com/http://github.com/[user]/'; //[user]の部分がユーザー名 | |
| txt += myPath.shift(); |
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
| #targetengine session | |
| var fonts = app.fonts; | |
| var fontLength = fonts.length; | |
| var fontList = []; | |
| var dlg = new Window("palette"); | |
| dlg.add("staticText", undefined, "フォントを読み込んでいます..."); | |
| dlg.alignChildren = "fill"; | |
| var pb = dlg.add("progressbar", undefined, 0, fontLength); |
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; | |
| var result = []; | |
| for (var k=1; k<compFonts.length; k++) { | |
| result.push("# " + compFonts[k].name); | |
| var cfEnt = compFonts[k].compositeFontEntries; | |
| for (var i=0; i<cfEnt.length; i++) { | |
| result.push("## " + cfEnt[i].name); | |
| result.push("* フォント:"+cfEnt[i].appliedFont+"/"+cfEnt[i].fontStyle); |
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 (){ | |
| //状態チェック | |
| if (app.documents.length === 0) { | |
| alert("ドキュメントを開いてから実行してください"); | |
| return; | |
| } | |
| if (app.selection.length === 0) { | |
| alert("オブジェクトを選択してから実行してください"); | |
| return; | |
| } |
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 doc = app.activeDocument; | |
| var pst = doc.allParagraphStyles; | |
| pst.splice(0, 2); | |
| var pstNameList = getNames(pst); | |
| var result = {}; //エラー結果を入れる配列 | |
| for (var i=0, ilen=pstNameList.length; i<ilen; i++) { | |
| for (var k=0, klen=pstNameList.length; k<klen; k++) { | |
| if (i === k) { | |
| continue; |
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 doc = app.activeDocument; | |
| var sel = doc.selection; | |
| var tgt = sel[sel.length-1]; | |
| var newSelection = []; | |
| app.doScript(main, ScriptLanguage.JAVASCRIPT, null, UndoModes.ENTIRE_SCRIPT); | |
| function main(){ | |
| var tempRuler = doc.viewPreferences.rulerOrigin; | |
| doc.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN; | |
| for (var i=sel.length-2; i>=0; i--) { |
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 doc = app.activeDocument; | |
| var pst = doc.allParagraphStyles; | |
| var len = pst.length; | |
| var tgtFolder = Folder.selectDialog("書き出し先のフォルダを選択"); | |
| for (var i=1; i<len; i++) { | |
| if (pst[i].parent.constructor.name === "ParagraphStyleGroup") { | |
| exportTxtFile(pst[i].parent.name+" >>> "+pst[i].name, getNestedStylesExp(pst[i])); | |
| } else { | |
| exportTxtFile(pst[i].name, getNestedStylesExp(pst[i])); | |
| } |
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 doc = app.activeDocument; | |
| var sel = doc.selection[0]; | |
| var startChar = parseInt("21", 16); //入力する文字の最初のコードポイント | |
| var endChar = parseInt("24ff", 16); //入力する文字の最後のコードポイント | |
| app.doScript(function(){ | |
| while(startChar < endChar) { | |
| sel.contents += String.fromCharCode(startChar); | |
| startChar++; | |
| } | |
| }, ScriptLanguage.JAVASCRIPT, null, UndoModes.ENTIRE_SCRIPT); |
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 F = Folder.selectDialog("フォルダを選択してください"); | |
| main(F, "filePath", true); | |
| function main(F, scptFile, closeFile) { | |
| var inddFiles = F.getFiles("*.indd"); | |
| var resAry = ["以下のファイルを正しく処理できませんでした"]; | |
| var indd, flag; | |
| if (!inddFiles) { | |
| exit(); | |
| } |
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 nsDefault = XmlService.getNamespace("urn:yahoo:jp:jlp:FuriganaService"); | |
| function parseXml() { | |
| var url = 'http://jlp.yahooapis.jp/FuriganaService/V1/furigana'; | |
| var params = [ | |
| 'appid=XXXXXXXXXXXXXXXXXXXX', | |
| 'sentence=' + encodeURIComponent('初音ミクさんを忘れないでください'), | |
| 'grade=1' | |
| ] | |
| var xml = UrlFetchApp.fetch(url + '?' + params.join('&') ).getContentText(); |