Skip to content

Instantly share code, notes, and snippets.

View tokyosheep's full-sized avatar

Shuji tokyosheep

View GitHub Profile
@tokyosheep
tokyosheep / appCloudOpen.jsx
Last active April 28, 2024 01:16
open cloud document on Photoshop
/*
this work as well.
I suppose cloud path has something type or pattern of string.
and the application detects cloud or local automatically.
*/
app.open(new File( "/cloud-content/tsukuda.psdc" ));
@tokyosheep
tokyosheep / saveCloudDocumentonPhotoshop.js
Last active April 28, 2024 01:15
save cloud doc on Photoshop
(function() {
var idsave = charIDToTypeID( "save" );
var desc266 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
var desc267 = new ActionDescriptor();
var idcloudPSDFormat = stringIDToTypeID( "cloudPSDFormat" );
desc266.putObject( idAs, idcloudPSDFormat, desc267 );
var idassetRef = stringIDToTypeID( "assetRef" );
//here is local id and filepath on cloud doc. replace the local id with yours
desc266.putString( idassetRef, {
/*
use as a psjs not as a js.
this script defines UI Dialog.
*/
const { createLayer } = require("./photoshopAPI.psjs");
//dialog size
const DIALOG_WIDTH = '550px';
const DIALOG_HEIGHT = '650px';
/*
this script creates solid color fill layer from gradient.
use this script as a psjs.
before executing script, select a gradient layer.
it creates solid color fill layer following point of color on gradeint layer.
requirement
later than Photoshop ver 23.5
/*
this is a UXP script for Photoshop
that labels layers on document.(except group layer)
you could set clause that layer's style.
(like locked or visible)
requirement
later than Photoshop ver 23.5
you could use this one for free.
@tokyosheep
tokyosheep / setGuids.js
Created November 23, 2022 06:01
Photoshop UXP Script that draws guides on document.
/**
* this is UXP Photoshop Script
* please save as a psjs file this one
* and load on Photoshop.
*
* requirement
* Photoshop later than 23.5
*/
const { app } = require("photoshop");
<nav class="nav">
  <form name="nav" class="nav__form"><!-- 基本inputタグはformタブで囲む -->
 <ul class="nav__link">
<li>
<label for="setGuideForm" class="nav__label"><!--label 要素でinput周りのタブを囲む-->
<input type="radio" class="nav__radio" name="tab" value="setGuide" id="setGuideForm" checked="true"/>
<!-- radio box本体 ただし最終的にinputタグは非表示にしてdivやspan要素で装飾する -->
<span class="nav__title">set guide</span>
</label>
</li>
import "../styles/style.scss";//sassを読み込み
import "@babel/polyfill";//polyfillを読み込み
window.onload = () =>{
"use strict";
const csInterface = new CSInterface();
}
npm i -D webpack-node-externals
"use strict";
const mode = "development";
const enabledSourceMap = mode === "development";
const path = require("path");
module.exports = {
mode:mode,
devtool:"source-map",
target:"node",
context:path.resolve(__dirname,"src"),