Skip to content

Commit

Permalink
scripts are working
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiantheblind committed Dec 3, 2010
1 parent a48eb51 commit b37dd71
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 81 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
typoStdImages/
typoStdTestImg/
*.psd
*.old
Binary file removed idml/Testing_TypoGrid_01.idml
Binary file not shown.
Binary file removed idml/Testing_TypoGrid_02.idml
Binary file not shown.
Binary file added idml/theTypoGrid.idml
Binary file not shown.
Binary file added imageGrid/Images/feet.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/fly.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/frog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/hammock.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/head.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/sky.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/theDoctor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/twoFace.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/Images/window.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-00.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-03.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-04.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-05.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-06.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-07.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imageGrid/TestImg/img-08.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 49 additions & 79 deletions imageGrid/imageGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,99 +10,69 @@ function main(){
var theFolder = Folder.selectDialog ("Choose a FOLDER to Import Images From");
var thePath = theFolder;
var theFileType = "*.jpg";
var theDoc = app.activeDocument;
var thePage = theDoc.pages.item(0);

var allImages = thePath.getFiles(theFileType);




for(var i = 0;i < allImages.length; i++){
var theBounds = buildBounds(allImages.length,i,thePage,theDoc);
var theRectangle = thePage.rectangles.add({
geometricBounds: theBounds//[50,50,100,100]
});
var theDoc = app.documents.add()
with (theDoc.documentPreferences) {
pageWidth = "210mm";
pageHeight = "210mm";
//BleedBox settings
documentBleedBottomOffset = "3mm";
documentBleedTopOffset = "3mm";
documentBleedInsideOrLeftOffset = "3mm";
documentBleedOutsideOrRightOffset = "3mm";
}
with (theDoc.viewPreferences) {
pageWidth = "210mm";
pageHeight = "210mm";
horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;
verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;
rulerOrigin = RulerOrigin.pageOrigin;

theRectangle.place(allImages[i]);
theRectangle.fit(FitOptions.CONTENT_TO_FRAME);

}


}
var theObjStyle = theDoc.objectStyles.add({name:"style"});
theObjStyle.transparencySettings.dropShadowSettings.distance = "2 mm";
theObjStyle.transparencySettings.dropShadowSettings.mode = ShadowMode.DROP;

function buildBounds( imgLength, index, thePage, theDoc){

var thePage = theDoc.pages.item(0);
var allImages = thePath.getFiles(theFileType);
var theSize = 50;
var gutter = 10;
var theValues = new Array;
var theBoard = thePage;
var count = index;
var offset = gutter + theSize;
var w = theDoc.documentPreferences.pageWidth;
var h = theDoc.documentPreferences.pageHeight;
var numORects = imgLength;

var xOffset;
var offset = gutter + theSize;



Y1 = ((h/2)-(theSize/2)) - offset;
X1 = (w/2)-(theSize/2) - offset;
Y2 = Y1 +theSize;
X2 = X1 +theSize;

for(var i = 0; i < 3; i++){
var Y1 = ((h/2)-(theSize/2)) - offset;
var X1 = (w/2)-(theSize/2) - offset;
var Y2 = Y1 +theSize;
var X2 = X1 +theSize;
for(var i = 0;i < allImages.length; i++){



for(var j = 0; j < 3; j++){

theValues[index] = [Y1,X1,Y2,X2];
}
var theRectangle = thePage.rectangles.add({
geometricBounds: [Y1,X1,Y2,X2]
});
theRectangle.place(allImages[i]);
theRectangle.fit(FitOptions.CONTENT_TO_FRAME);
theRectangle.applyObjectStyle( theDoc.objectStyles.item("[Ohne]"));

theRectangle.applyObjectStyle( theObjStyle);

X1 = X1 + offset;
if(X1 > w - theSize){
Y1 = Y1 + offset;
X1 = (w/2)-(theSize/2) - offset;
}

/*
switch(index){
case 0,1,2:
Y1 = ((h/2)-(theSize/2)) - offset;
X1 = (w/2)-(theSize/2) - offset;
Y2 = ((h/2)+(theSize/2)) - offset;
X2 = (w/2)+(theSize/2) -offset;
break;
case 6,7,8:
Y1 = ((h/2)-(theSize/2)) + offset;
X1 = (w/2)-(theSize/2) + offset;
Y2 = ((h/2)+(theSize/2)) + offset;
X2 = (w/2)+(theSize/2) + offset;
break;
}
switch(index){
case 0,3,6:
Y1 = ((h/2)-(theSize/2)) - offset;
X1 = ((w/2)-(theSize/2)) - offset;
Y2 = ((h/2)+(theSize/2)) - offset;
X2 = ((w/2)+(theSize/2)) - offset;
break;
case 2,5,8:
Y1 = ((h/2)-(theSize/2)) + offset;
X1 = ((w/2)-(theSize/2)) + offset;
Y2 = ((h/2)+(theSize/2)) + offset;
X2 = ((w/2)+(theSize/2)) + offset;
break;
Y2 = Y1 +theSize;
X2 = X1 +theSize;
}
switch(index){
case 4:
Y1 = (h/2)-(theSize/2);
X1 = (w/2)-(theSize/2);
Y2 = (h/2)+(theSize/2);
X2 = (w/2)+(theSize/2);
break;
}
*/




return theValues[index];
// return [50,50,100,100]

}

1 change: 0 additions & 1 deletion makeImg/makeTypoImg.jsx

This file was deleted.

1 change: 0 additions & 1 deletion makeImg/nextFile.txt

This file was deleted.

1 change: 1 addition & 0 deletions makeImg/theTypoGrid.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main();function main (){ #include "theValues.jsx"; var theValues = theValues();//var myLines = app.selection[0].lines.everyItem();var theDoc = buildDoc();var thePage = theDoc.pages.item(0);var w = theDoc.documentPreferences.pageWidth;var h = theDoc.documentPreferences.pageHeight;var theSize = 333;var Y1 = (h/2)-(theSize/2);var X1 = (w/2)-(theSize/2);var Y2 = Y1 + theSize;var X2 = X1 + theSize;var theContent = buildContent();var theFrame = thePage.textFrames.add(); theFrame.geometricBounds= [Y1,X1,Y2,X2]; theFrame.contents = theContent; var theParagraphs = theFrame.paragraphs.everyItem(); var theCharacters = theFrame.characters.everyItem();theParagraphs.leading = "44 pt";theCharacters.pointSize = "79 pt";theParagraphs.justification = Justification.CENTER_JUSTIFIED;for(var k = 0; k < theFrame.characters.length;k++){ var c =theFrame.characters.item(k); //c.fillTint = Math.random()*100; c.fillTint = theValues[k]; }}/*// this is if the typo grid is allready there// and you select the the whole textfor(var i = 0; i<app.selection[0].characters.length;i++){ var c = app.selection[0].characters[i]; //c.fillTint = Math.random()*100; c.fillTint = theValues[i]; } */ function buildContent(){ var theContent = ""; var theString = ""; for (var i = 0; i < 19; i++){ theString = theString + "o"; } for(var j = 0; j < 20; j++){ theContent = theContent + theString +"\n"; } return theContent; } function buildDoc(){ var theDoc = app.documents.add() with (theDoc.documentPreferences) { pageWidth = "1189 mm"; pageHeight = "841 mm"; //BleedBox settings documentBleedBottomOffset = "3mm"; documentBleedTopOffset = "3mm"; documentBleedInsideOrLeftOffset = "3mm"; documentBleedOutsideOrRightOffset = "3mm"; } with (theDoc.viewPreferences) { pageWidth = "1189 mm"; pageHeight = "841 mm"; horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS; verticalMeasurementUnits = MeasurementUnits.MILLIMETERS; rulerOrigin = RulerOrigin.pageOrigin; } return theDoc;}
Expand Down
File renamed without changes.

0 comments on commit b37dd71

Please sign in to comment.