This file contains 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
try{ | |
var no_no = nothing; // nothing does not exist | |
// so this produces an error | |
}catch(e){ | |
// open a window and show the alert. | |
// \n is just a breakline | |
// \" is to show quotation marks in text | |
alert("This is the error message \"e\":\n" + e); | |
} |
This file contains 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
app.activeDocument.selection; |
This file contains 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
// createBook.jsx | |
// creates a InDesign Book from .md files | |
// dependencies as follow | |
// font | |
// folder called images in jekyll folder | |
// some find change queries | |
// https://github.com/fabiantheblind/MT4D-GREP | |
// place them under: | |
// /Users/[YOUR USERNAME]/Library/Preferences/Adobe InDesign/Version [NUMBER]/[LOCALIZATION de_DE]/Find-Change Queries/GREP |
This file contains 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
// include the io lib | |
#include<stdio.h> | |
// the compare function takes integer as arguments | |
int compare(int a, int b){ | |
if(a>b){return a;}else{return b;} | |
} | |
// the main function | |
int main(void){ | |
char name[11] = "Hello World"; // our string | |
int a = 23,b = 5; // the values to compare |
This file contains 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
// the string and io classes | |
#include <iostream> | |
#include <string> | |
//using namespace std; // if you use this you can remove all "std::" | |
class Object{ /* our object*/ | |
public: | |
std::string name; // its name |
This file contains 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
main(); // call the main function | |
function main(){ /* here wee go */ | |
var obj = new buildNewObject("Hello JS"); // create a new Object | |
var a = 23, b = 5; // define the values | |
obj.compare(a,b); // let the object compare the values | |
// and make the message | |
alert("The Script named: "+ obj.name + | |
"\nCompared: "+ a +" with "+ b +"\n" |
This file contains 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
// rd_MasksToShapes.jsx | |
// Copyright (c) 2007 redefinery (Jeffrey R. Almasol). All rights reserved. | |
// check it: www.redefinery.com | |
// | |
// Name: rd_MasksToShapes | |
// Version: 0.7 | |
// | |
// Description: | |
// This script creates a shape layer with paths for each mask on the | |
// selected layer. |
This file contains 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
// Like Uncle Ben saz: "With great power comes great responsability!" | |
app.documents.everyItem().close(SaveOptions.YES); |
This file contains 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
var doc = app.documents.add(); | |
doc.pages.item(0).textFrames.add({ | |
geometricBounds:[13,13,23,50], | |
contents:"Hello InDesign"}); |
This file contains 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
{ | |
main(); | |
function main(){ | |
app.beginUndoGroup("Split Shape layer"); | |
var curComp = app.project.activeItem; | |
if (!curComp || !(curComp instanceof CompItem)){ | |
alert("Please select a Composition."); | |
return; |