Skip to content

Instantly share code, notes, and snippets.

trych

Block or report user

Report or block trych

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@trych
trych / getLastInlineRange.js
Last active Sep 6, 2019
Demonstrates how to retrieve a text object resembling the last text style range *within* a single line.
View getLastInlineRange.js
#target indesign
// use on some text frame with several text style ranges in the first line
// if the text range continues into the second line, only the range within the first line will be returned
var l = app.activeDocument.textFrames.firstItem().lines.firstItem();
var lir = getLastInlineRange(l);
app.select(lir);
function getLastInlineRange(l) {
var ltsr = l.textStyleRanges.lastItem();
@trych
trych / ExportMailAdresses.scpt
Last active Jul 26, 2019
Exports all "From" addresses of a specific email inbox to Numbers for further processing. Duplicates are still present and need to be removed in the spreadsheet app.
View ExportMailAdresses.scpt
tell application "Numbers"
set LinkRemoval to make new document
set theSheet to active sheet of LinkRemoval
tell table 1 of theSheet
set the value of cell 1 of column "A" to "From"
end tell
end tell
@trych
trych / DottedCircle.pde
Created Jun 8, 2018
A dotted circle in Processing. Note that the dotted line is only faked by drawing lines in the background color on top.
View DottedCircle.pde
size(512, 512);
background(255);
strokeWeight(20);
translate(width / 2, height / 2);
ellipse(0, 0, 400, 400);
stroke(255);
View foreEdgePrinting.js
// @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
@trych
trych / Bundschnitt.js
Last active Aug 2, 2016
Bundschnitt erstellen
View Bundschnitt.js
#target indesign
var doc = app.activeDocument;
doc.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN;
doc.documentPreferences.allowPageShuffle = false;
cleanDocument(doc);
@trych
trych / RemoveRecent.jsx
Created Dec 21, 2015
InDesign Remove Recent Items
View RemoveRecent.jsx
#target InDesign
var userOR = app.generalPreferences.openRecentLength;
app.generalPreferences.openRecentLength = 0;
app.generalPreferences.openRecentLength = userOR;
@trych
trych / RemoveRecentSU.jsx
Last active Dec 21, 2015
InDesign Remove Recent Items StartUp-Script
View RemoveRecentSU.jsx
#target InDesign
#targetengine "removeRecentItems"
var menuName = "Remove Recent";
var removeAction = app.scriptMenuActions.add(menuName);
removeAction.eventListeners.add("onInvoke", removeRecentItems);
removeAction.eventListeners.add("beforeDisplay", recentAvailable);
var mainMenu = app.menus.itemByName("$ID/Main");
@trych
trych / ES_IndentFirstLineToPrevious.js
Created Nov 7, 2015
ExtendScript: Fit firstLineIndent to previous paragraph
View ES_IndentFirstLineToPrevious.js
// fits the firstLineIndent of a paragraph to the end of the previous paragraph
// as asked here: https://graphicdesign.stackexchange.com/questions/62916/
#target InDesign
var defaultIndent = 5;
//Checks if a text frame with 2 or more paragraphs was selected.
if (app.selection.length < 1 || !(app.selection[0].parentStory.paragraphs.length > 1)) {
alert("Error\nSelect a text frame with at least 2 paragraphs and try again.");
You can’t perform that action at this time.