Skip to content

Instantly share code, notes, and snippets.

View amolok's full-sized avatar

amolok amolok

  • Saint Petersburg, Russia
View GitHub Profile
@amolok
amolok / export current layer to JPEG.jsx
Created November 23, 2012 05:31
AI: export to jpg with current filename + current layer name
/**********************************************************
export to jpg with filename += layer.name
**********************************************************/
// Main Code [Execution of script begins here]
// uncomment to suppress Illustrator warning dialogs
// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, jpgSaveOpts;
@amolok
amolok / export all datasets from current layer to JPEG.jsx
Created November 23, 2012 05:32
AI: export all datasets from current layer to JPEG
/**********************************************************
export to jpg with filename += dataSet.name
**********************************************************/
// Main Code [Execution of script begins here]
// uncomment to suppress Illustrator warning dialogs
// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
// var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, jpgSaveOpts;
@amolok
amolok / export all datasets from current layer to PDF.jsx
Created November 23, 2012 05:35
AI: export all datasets from current layer to PDF
/**********************************************************
export to PDF with filename += dataset.name
**********************************************************/
// Main Code [Execution of script begins here]
// uncomment to suppress Illustrator warning dialogs
// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
// Select the source folder.
@amolok
amolok / markes.js
Created November 23, 2012 05:40
AI: add coords labels to selected objects
/* add coords to marks */
var items = selection;
if (items.length>0) {
for (i=0; i<items.length; i++) {
var x = getX(items[i]);
var y = getY(items[i]);
// alert(i + ': x' + x + ' y' + y);
markPosition (items[i]);
@amolok
amolok / namedImageLayers.js
Created November 23, 2012 05:45
AI: name all placed images on selected layer with their filenames
/**********************************************************
Description: name all placed items (images)
in selected layer with their filenames
tested on Windows 7 Adobe Illustrator 5.0
**********************************************************/
if (app.documents.length>0) {
var d = app.activeDocument;
var l = d.activeLayer;
var r = l.placedItems;
@amolok
amolok / renumber.cmd
Created November 23, 2012 06:04
cmd: Windows 7 batch loop file renumber with leading zeroes
@echo off
echo renumber.cmd folder start total
echo ===============================
setlocal EnableDelayedExpansion
set /a start = %2
if NOT DEFINED [%3] (
for %%a in (.\%1\*.png) do ( set /a i+=1 )
echo Total files in folder %1: !i!
@amolok
amolok / split.cmd
Created November 23, 2012 06:50
cmd: Split files by folders
@echo off
echo split.cmd folder loop
echo -------------------------------
setlocal EnableDelayedExpansion
for %%a in (.\%1\*.png) do ( set /a i+=1 )
echo Total files in folder %1: !i!
set /a total = i
set /a folders = !total! / %2
echo Move *.png in folder %1 to subfolders [00..!folders!] by %2 files
@amolok
amolok / gist:7152925
Created October 25, 2013 10:59
MODx youtuBe links handler
<?php
/*
* [[!youtuBe?
* &tpl
* &links
* &outCls
* &rowCls
* &imgCls
* &linkPref
*/
@echo off
IF [%1]==[] (
echo renumbers.cmd filemask filename digits start digits start cycle
echo ~~~~~~~~~~~~~ bon_*.bmp bon 2 1 1 1 4
echo bon011.bmp bon012.bmp bon013.bmp bon014.bmp bon021.bmp bon022.bmp ...
echo ------------------------------------------------------------------------------------
) ELSE (
setlocal EnableDelayedExpansion
set prefix = %2
@echo off
IF [%1]==[] (
echo renumber01.cmd filemask filename
echo bis_*.bmp bis
echo bis01.bmp bis02.bmp bis03.bmp ...
echo ------------------------------------------------------------------------------------
) ELSE (
setlocal EnableDelayedExpansion
set prefix = %2