Skip to content

Instantly share code, notes, and snippets.

View ten-A's full-sized avatar

Ten ten-A

View GitHub Profile
@ten-A
ten-A / action_fixer.jsx
Created June 10, 2016 05:25
Generate corect action strings.
var sjisCd = [];
cvtable_init();
var f = File.openDialog("Select Action File...");
var re = /value\s\[\s56/;
var rtg = /[0-9a-f]+/;
var ed = /\t+\]/;
var st = "";
var tgtString = "";
var flg = false;
if (f.open('r')){
@ten-A
ten-A / ComplexFieldComputingLib.jsx
Last active June 17, 2016 03:03
Complex Field Computing Library for Extendscript
// complex numbers Constructer
function C(r,i){
this.r = r; //real
this.i = i; //imaginary
}
//compute complex value
function Cconj(c){ //conjunction
return new C(c.r, -c.i);
}
@ten-A
ten-A / languageIDExtracter.jsx
Created June 21, 2016 03:01
Pick up Language informations from Open Type Font.
var MacLangID = ['English','French','German','Italian','Dutch','Swedish','Spanish','Danish','Portuguese',
'Norwegian','Hebrew','Japanese','Arabic','Finnish','Greek','Icelandic','Maltese','Turkish','Croatian',
'Chinese (Traditional)','Urdu','Hindi','Thai','Korean','Lithuanian','Polish','Hungarian','Estonian',
'Latvian','Sami','Faroese','Farsi/Persian','Russian','Chinese (Simplified)','Flemish','Irish Gaelic',
'Albanian','Romanian','Czech','Slovak','Slovenian','Yiddish','Serbian','Macedonian','Bulgarian',
'Ukrainian','Byelorussian','Uzbek','Kazakh','Azerbaijani (Cyrillic script)','Azerbaijani (Arabic script)',
'Armenian','Georgian','Moldavian','Kirghiz','Tajiki','Turkmen','Mongolian (Mongolian script)',
'Mongolian (Cyrillic script)','Pashto','Kurdish','Kashmiri','Sindhi','Tibetan','Nepali','Sanskrit',
'Marathi','Bengali','Assamese','Gujarati','Punjabi','Oriya','Malayalam','Kannada','Tamil','Telugu',
'Sinhalese','Burmese','Khmer','Lao','Vietnamese','Indonesian','Tagalong','Malay (Roman script)',
@ten-A
ten-A / cep_cmp.js
Created June 29, 2016 05:46
Integrated CSInterface and Vulcan libraries.
function CSInterface(){}function CSXSWindowType(){}CSXSWindowType._PANEL="Panel";CSXSWindowType._MODELESS="Modeless";CSXSWindowType._MODAL_DIALOG="ModalDialog";EvalScript_ErrMessage="EvalScript error.";function Version(a,b,c,d){this.major=a;this.minor=b;this.micro=c;this.special=d}Version.MAX_NUM=999999999;function VersionBound(a,b){this.version=a;this.inclusive=b}function VersionRange(a,b){this.lowerBound=a;this.upperBound=b}function Runtime(a,b){this.name=a;this.versionRange=b}
function Extension(a,b,c,d,e,f,g,h,k,l,n,p,q,r,t,u){this.id=a;this.name=b;this.mainPath=c;this.basePath=d;this.windowType=e;this.width=f;this.height=g;this.minWidth=h;this.minHeight=k;this.maxWidth=l;this.maxHeight=n;this.defaultExtensionDataXml=p;this.specialExtensionDataXml=q;this.requiredRuntimeList=r;this.isAutoVisible=t;this.isPluginExtension=u}function CSEvent(a,b,c,d){this.type=a;this.scope=b;this.appId=c;this.extensionId=d}function SystemPath(){}SystemPath.USER_DATA="userData";
SystemPath.COMMON_FILES="commonFiles";SystemPath
@ten-A
ten-A / getLayersColor.jsx
Created July 6, 2016 06:12
Retrieve layers color value.
//Need to include stdlibs in xtools. You can reference below link.
//http://ps-scripts.sourceforge.net/xtools.html
#include "stdlib.js"
var desc = Stdlib.getLayerDescriptor(
app.activeDocument,
app.activeDocument.activeLayer
);
var adjs = desc.getList(cTID('Adjs'));
@ten-A
ten-A / activateLibrariyPanel.jsx
Created July 6, 2016 08:27
Activate the Library panel when the Illustrator s
app.launchExtension("com.adobe.DesignLibraries.angular");
@ten-A
ten-A / pathExamine.jsx
Created August 5, 2016 02:29
Illustrator's path -> Type2Charstring array.
function pathExamine(tg) {
var baseline = 120; //global preset
var stck = [];
var crnt = []
stck.push(Math.round(tg.pathPoints[0].anchor[0]));
stck.push(Math.round(tg.pathPoints[0].anchor[1]+1000 -baseline));
var prv = stck;
stck.push("rmoveto");
for (var i=0;i<tg.pathPoints.length;i++){
crnt = [Math.round(tg.pathPoints[i].rightDirection[0]),