Skip to content

Instantly share code, notes, and snippets.

View hilukasz's full-sized avatar

Łukasz Wieczorek hilukasz

View GitHub Profile
<script>for(var e,l='article aside figcaption figure footer header hgroup section time'.split(' ');e=l.pop();document.createElement(e))</script>
function runMe() {
if(i == 2){
return true
}
}
for(var i = 0; i < something.length; i++){
runMe(i);
}
//start script
var subLayers = app.activeDocument.layers.getByName("parent").pageItems;
var smallestParentArea = 100000000;
var parentSmallest = [];
var smallestChild = "no smallest child found yet";
//loop through all sublayers to find children
for(var i = 0; i < subLayers.length; i++){
var smallestChild;
function SymbolContainer(theSymbol){
this.child = null; // reference to single child container
this.symbolItems = null; //array of symbols
this.parent = null;
}
SymbolContainer.prototype.checkIfChild = function(containerToCheckIfChild) {
this.parent = [];
var childVB = containerToCheckIfChild.visibleBounds,
childLeft = childVB[0],
var subLayers = app.activeDocument.layers.getByName("parent").pageItems;
var smallestParentArea = 10000000;
var smallestChild = "this is the first smallest child found";
var parentSmallest = [];
//loop through all sublayers to find children
for(var i = 0; i < subLayers.length; i++){
var smallestChild,
childContainer = subLayers[i],
// objects and methods
function Container(theChild){
this.value = theChild; // reference to single child container
this.symbolItems = []; //array of symbols
this.parent = [];
}
//$.writeln(mySymbolContainer.parent);
#target illustrator
function init(){
// @include lukaszLibrary.jsx
// objects and methods
function Container(theChild){
this.value = theChild; // reference to single child container
this.symbolItems = []; //array of symbols
this.parent = [];
width,height,top,left,name,parent container,type,color,text size(px),alignment,font name,font style,date/time exported
255,255,,,,Canvas
11,11,27.6220703125,3.60205078125,undefined.png, top left green of lime parent,image,,,,,,dateTime
,15,20,7.54443359375,9.3076171875,undefined.png, top left green of lime parent,image,,,,,,dateTime
11,11,3.7939453125,6.29443359375,undefined.png, orange footer,image,,,,,,dateTime
11,11,27.6220703125,3.60205078125,undefined.png, - parent inner,image,,,,,,dateTime
,15,20,7.54443359375,9.3076171875,undefined.png, - parent inner,image,,,,,,dateTime
function getAllTextItems(){
var doc = app.activeDocument;
for(var j = 0; j < doc.textFrames.length; j++){
var currentTextItem = doc.textFrames[j];
// loop through all the symbols to check if it is in the div
for(var i = 0; i < allParentsOfSymbols.length; i++){
var container = allParentsOfSymbols[i];
if(textIsIn(currentTextItem, container)) {
var left = Math.round(currentTextItem.anchor[0]),
top = Math.round(currentTextItem.anchor[1]),
<?php
//########################################################
// edit custom columns display for back-end
//########################################################
// ADDING CUSTOM POST TYPE
add_filter( 'manage_posts_columns', 'fb_AddThumbColumn' );
add_action( 'manage_posts_custom_column', 'fb_AddThumbValue', 10, 2 );