Created
April 4, 2018 10:16
-
-
Save trych/87cd5eb1b54028570442429e84b5ba83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @includepath "~/Documents/;%USERPROFILE%Documents"; | |
// @include "basiljs/basil.js"; | |
// HOW TO USE: | |
// - to run the script, you first need to install basil.js: http://basiljs.ch | |
// - Make sure, you're on the first page of your doc | |
// - select the page item that you want to appear in the fore edge | |
// - rotate it accordingly | |
// - if using text, convert to outlines | |
// - run the script, enter the required # of pages | |
// - if you just need the very edge to be printed on, you can just create a new | |
// layer, and place a paper colored rectangle on the master page to cover most | |
// of the page item | |
function draw() { | |
var doc = b.doc(); | |
doc.documentPreferences.facingPages = false; | |
doc.documentPreferences.pagesPerDocument = 1; | |
var sel = b.selection(); | |
var targetPageCount = prompt("Required # of Pages", 100); | |
var stepWidth = b.bounds(sel).width / (targetPageCount - 1); | |
b.itemX(sel, b.width); | |
for (var i = 1; i < targetPageCount; i++) { | |
b.addPage(); | |
b.page(i + 1) | |
var dup = b.duplicate(sel); | |
b.itemX(dup, b.itemX(dup) - stepWidth * i); | |
} | |
} | |
b.go(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment