Skip to content

Instantly share code, notes, and snippets.

View onebitious's full-sized avatar

onebitious

View GitHub Profile
/*
仕様
2022/11/26 記述
ダイアログを開き、処理するファイルが格納されたフォルダを選択。
「いくつおきに処理しますか?」のダイアログで何枚おきに処理するかの数値を入力します。
「おきに」とは「置きに」と書きます。
例;
「0」と入力
1、2、3、4、5、6、7、8、9、10.....
「1」と入力
@onebitious
onebitious / creatNewArtBoard.jsx
Created January 25, 2019 00:26
creatNewArtBoard
mainScript: { //処理中断のためのラベル
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ドキュメントの有無による処理判別
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
try {
if (app.activeDocument) {
//alert("OK");
}
} catch (e) {
alert("ドキュメントが開いていません。\r\n新規ドキュメントを作成してから実行してください。");
@onebitious
onebitious / 指定行に長体処理_ボタン版.jsx
Created March 8, 2018 13:57
指定行数に長体処理するIllustratorツールを作りました。 ref: https://qiita.com/onebitious/items/038c069e9825b28b114c
#target illustrator-22
#targetengine main
/*////////////////////////////////////////////////// 変数定義 ////////////////////////////////////////////////////////////////////*/
var doc = app.activeDocument; //ドキュメント
/*/////////////////////////////////////////////// 入力ダイアログ表示 ////////////////////////////////////////////////////////*/
win = new Window("palette", "指定行数に長体処理", [200, 150, 350, 300]);
var para01Btn = win.add("button", [10, 10, 70, 30], "1行");
var para02Btn = win.add("button", [10, 35, 70, 55], "2行");
@onebitious
onebitious / 画像の枚数分ページごとに配置.jsx
Created February 19, 2018 12:19
複数の画像を1ページづつに配置するJSXツールを作った話。InDesign ref: https://qiita.com/onebitious/items/83a033ba7a3f71be79d2
//▼サイズ指定ウィンドウ表示
var win = app.dialogs.add({
name: "ドキュメントサイズを選択"
});
var dlgClmn = win.dialogColumns.add();
var btnGrp = dlgClmn.radiobuttonGroups.add();
var a4Btn = btnGrp.radiobuttonControls.add({
staticLabel: "A4 (210 x 297mm)",
minWidth: 150,
checkedState: true
@onebitious
onebitious / Lチカもどき.html
Last active February 14, 2018 11:33
役に立たない Lチカ(もどき)w ref: https://qiita.com/onebitious/items/78e778d8c7d9a1bb47b2
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Lチカ もどき</title>
<style>
/*リセットCSS*/
* {
margin: 0;
@onebitious
onebitious / rondomColoring.jsx
Created January 30, 2018 14:02
Illustratorで塗り色、線の色をランダムな色で着色するツールを作ってみた。 ref: https://qiita.com/onebitious/items/589b50f34a5828617140
//#target illustrator
//#targetengine mainProcess
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
入力ダイアログ表示
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
win = new Window("palette", "ランダムに着色", [200, 150, 480, 300]);
win.add("statictext", [10, 15, 200, 30], "対象を選んでください。");
var fillValue = win.add("radiobutton", [30, 40, 100, 60], "塗り");
fillValue.value = true;
fillValue.active = true;
@onebitious
onebitious / deployAsSmartObjectLayers.jsx
Created January 25, 2018 13:56
Photoshop、レイヤーに画像配置後スマートオブジェクトに変換するツールを作ってみた。 ref: https://qiita.com/onebitious/items/c7e9590fc76d92a59466
MAIN: { //ラベル
flag = false;
while (flag == false) {
var fol = Folder.selectDialog("画像が格納されているフォルダを選択してください。"); //フォルダを選択
if (fol == null) { //キャンセルの場合 ※ゴミ箱を選んでもnullが返る
alert("キャンセルします。");
break MAIN;
}
var selFiles = fol.getFiles(); //ファイルを取得
@onebitious
onebitious / 01_Illustrator_複数画像をレイヤー別に中央配置.jsx
Last active January 13, 2018 04:32
画像の数だけレイヤー別に配置し、スマートオブジェクトに変換するツールを作ってみた。 ref: https://qiita.com/onebitious/items/13b11900d2ff394213ee
//▼新規ドキュメント作成
var docWidth = 841.89; //ページの横幅。297mm
var docHeight = 595.276; //ページの縦幅。210mm
var docObj = documents.add(DocumentColorSpace.RGB, docWidth, docHeight); //RGB空スペースでドキュメント作成
var recObj = docObj.pathItems.rectangle(0, 0, 841.89, -595.276); //ドキュメントサイズに矩形を作成
recObj.filled = false; //塗りなし
recObj.stroked = false; //線なし
//▼日付を取得
var date = new Date();
@onebitious
onebitious / filesAutoExpot.jsx
Last active March 25, 2017 11:07
Photoshopの「書き出し形式」風に、複数ファイルを処理するツールを作ってみた話。 ref: http://qiita.com/onebitious/items/39d008c900f53a5f0d9f
MAIN: { //ラベル
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
入力ダイアログ表示
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
var flag = false; //フラグの初期化
while (flag == false) {
var myDialog = new Window('dialog', '書き出し設定', [800, 250, 1060, 450]); //見出し
myDialog.staticText = myDialog.add("statictext", [10, 5, 275, 25], "保存するファイル形式を選択してください。"); //固定テキスト
myDialog.dropDownList = myDialog.add("dropdownlist", [10, 30, 250, 50], ["PNG", "JPEG", "GIF"]); //ドロップダウンリスト
myDialog.dropDownList.selection = 0; //デフォルトで一番上のものを選択
@onebitious
onebitious / I_am_a_cat.html
Created February 6, 2017 13:35
【修正版】IllustratorからHTML、CSSに書き出すツール ref: http://qiita.com/onebitious/items/de179f82bcfabc935637
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
h1 {
font-size: 31.24px;
font-family: HGS行書体;