Skip to content

Instantly share code, notes, and snippets.

View tokyosheep's full-sized avatar

Shuji tokyosheep

View GitHub Profile
this.fileList = (function(){
var fileList = [];
var mainFolder = Folder.selectDialog(“フォルダを選択してください”);
if(!mainFolder){ return false; }
var files = mainFolder.getFiles();
for(var i=0;i<files.length;i++){
if(files[i].getFiles !== undefined){//フォルダー以外取得
continue;
}else{
fileList.push(decodeURI(files[i]));//日本語にも対応するようにデコード
//this.fileList フォルダダイアログから取得した画像ファイル
//this.images すでにillustratorに配置されている画像ファイル
if(!this.fileList){
return;
}
for(var i=0;i<this.images.length;i++){
for(var j=0;j<this.fileList.length;j++){
var flag = isNameSame(this.images[i].file.name,this.fileList[j]);
if(flag){
this.images[i].file = new File (this.fileList[j]);//置き換え
<h3>loading...</h3>
<div class="loadingStyle">
<div class="loadingStyle-bar"></div>
<div class="loadingStyle-bar"></div>
<div class="loadingStyle-bar"></div>
</div>
</div>
<div id="content">
<div>
#loading{
background: #333;
color: #fff;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
position: fixed;
window.onload = ()=>{
`use strict`;
const csInterface = new CSInterface();
themeManager.init();
const btn_test = document.getElementById(`btn_test`);
const loading = document.getElementById(`loading`);
btn_test.addEventListener(`click`,saveJpegs);
async function saveJpegs(){
loading.style.display = `block`;
(function(){
var winObj = new Window("dialog","sample",[100,50,450,300]);
winObj.p = winObj.add("progressbar",[80,20,80+200,20+15],0,200);
winObj.Ok = winObj.add("button",[70,200,70+80,200+25], "OK!");
winObj.cancel = winObj.add("button",[200,200,200+80,200+25], "Cancel");
winObj.center();
winObj.cancel.onClick = function(){
winObj.close();
}
(function(){
uDlg = new Window('dialog','sample',[200,100,580,345]);
uDlg.cBox1 = uDlg.add("checkbox",[130,40,275,40+25], "チェック");
uDlg.okBtn = uDlg.add("button",[130,100,225,100+25], "OK!");
uDlg.cancelBtn = uDlg.add("button", [130,160,225,160+25], "Cancel");
uDlg.center();
uDlg.okBtn.onClick = function(){
alert(uDlg.cBox1.value);
uDlg.close();
uDlg.okBtn.onClick = function(){
alert(uDlg.cBox1.value);
uDlg.close();
}
uDlg = new Window('dialog','sample',[200,100,580,345]);
uDlg.okBtn = uDlg.add("button",[130,100,225,100+25], "OK!");