Skip to content

Instantly share code, notes, and snippets.

@iconifyit
iconifyit / SVGExportAction.jsx
Last active December 10, 2023 00:59
Creates an Adobe Illustrator action to export to SVG on-the-fly.
/*
* This script creates an Adobe Illustrator action, on-the-fly, to export to SVG. The main thing to
* understand is that the `name` values in the action code are hexadecimal-encoded strings. The number
* that immediately preceeds the encoded name are the length of the hex string divided by 2.
*
* Usage:
*
* Change the `basePath` variable to match your file system. This can be set to any folder you like.
*
* Credits:
@douglascrp
douglascrp / VBScript class for json encode decode
Created December 20, 2018 17:47
JSON encode decode with VBScript
Reference: http://demon.tw/my-work/vbs-json.html
VbsJson class for parsing JSON format data with VBS
Tags: JavaScript , JSON , VB , VBS , VBScript
Title: The VBS resolve VbsJson class of JSON data format of: Demon
Link: http://demon.tw/my-work/vbs-json.html
Copyright: All articles in this blog are subject to the terms of " Signature - Non-Commercial Use - Share 2.5 China in the Same Way ".
@kdarty
kdarty / Web.xml
Created September 23, 2016 12:09
Define Web Font Mime Types within the Web.config of an ASP.NET Project to ensure that the Web Server properly handles serving up your Fonts.
<system.webServer>
<staticContent>
<!-- Remove any potential Web Server Settings for Web Fonts to be used -->
<remove fileExtension=".eot" />
<remove fileExtension=".otf" />
<remove fileExtension=".ttf" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<!-- Define Web Font Mime Types that will be used -->
@moluapple
moluapple / find visual center.jsx
Last active September 17, 2023 06:16
[Illustrator] 寻找不规则形状中心点(find visual center of an irregularly shaped polygon with Illustrator)
(function() {
var doc = app.activeDocument,
lays = doc.layers,
WORK_LAY = lays.add(),
NUM_LAY = lays.add(),
i = lays.length - 1,
lay;
// main working loop
for (; i > 1; i--) {
@daluu
daluu / loadUrlSynchronously.jsx
Created April 8, 2015 22:10
Loads data from a URL in Adobe Illustrator, synchronously! (Uses Bridge behind the scenes)
BridgeTalk.prototype.sendSynch = function(timeout) {
var self = this;
self.onResult = function(res) {
this.result = res.body;
this.complete = true;
}
self.complete = false;
self.send();
if (timeout) {
body {
background-color: black;
}
@TomByrne
TomByrne / MultiExporter.jsx
Last active April 2, 2025 10:37
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to [email protected]
@mericson
mericson / loadUrl.jsx
Created September 10, 2013 14:13
Loads data from a URL in Adobe Illustrator! (Uses Bridge behind the scenes)
var doc = app.activeDocument;
var docPath = doc.path;
function loadUrl(url, callback) {
var bt = new BridgeTalk();
bt.target = 'bridge' ;
@moluapple
moluapple / A realworld example.jsx
Created August 11, 2012 06:42
[Illustrator] Relaunch AI to aviod "PARM" error
// Origin discussion: http://forums.adobe.com/message/4613051
#target "estoolkit"
rasterizeFolder();
/********************************************************************************************/
function rasterizeFolder() {
//Get the source and destination folders.
//If either window is cancelled, end the script.
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};