Skip to content

Instantly share code, notes, and snippets.

View nukleas's full-sized avatar

Nader Heidari nukleas

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@nukleas
nukleas / simplefindchange.jsx
Created February 18, 2013 22:43
A simple find/change that uses a tab-delimited text file as input for Indesign/InCopy
// Simple Find-Change with Range
function myDisplayDialog() {
"use strict";
var findChangeTarget, dialogWindow, diaColRows, targetRangeButtons;
dialogWindow = app.dialogs.add({name: "Find/Change"});
diaColRows = dialogWindow.dialogColumns.add().dialogRows.add(); // Just to shorten the line so it reads easier
diaColRows.staticTexts.add({staticLabel: "Search Range:"});
targetRangeButtons = diaColRows.radiobuttonGroups.add();
targetRangeButtons.radiobuttonControls.add({staticLabel: "Document", checkedState: true});
targetRangeButtons.radiobuttonControls.add({staticLabel: "Selected Story"});
@nukleas
nukleas / tab_txt-to-findchangebylist_indesign.jsx
Created February 18, 2013 22:41
Quick convert a tab-delimited file with <text to find><tab><text to replace> to findChangeByList format
function openFile() {
"use strict";
var filePath, open_file;
/*
Instead of a hard-coded path, I decided to just have a dialog.
This is so you don't have to worry about changing the code too much.
*/
filePath = File.openDialog("Choose the file containing your find/change list");
if (filePath && filePath.open("r", undefined, undefined)) {
open_file = new File(filePath);
@nukleas
nukleas / incopy-pdf-export.jsx
Created May 4, 2012 20:20
inCopy Instant PDF Export
//Instant PDF Export
//Written by Nukleas
//
//
myStory = app.activeDocument.name; // Pulls the name of the document
myStory = myStory.split(/[\s.]+/); // Trims the stuff after the . or spaces, which is usually junk like [Pr] or .icml
app.layoutPDFExportPreferences.viewPDF = true //Force view PDF after export (Galley)
app.galleyPDFExportPreferences.viewPDF = true //Force view PDF after export (Galley)
myTypeNumber=app.documents.item(0).windows.item(0).viewTab; //This checks which view tab (Galley, Story, Layout) and sets that value to myTypeNumber
if(myTypeNumber==1699504505){// If it's layout, (The data comes in as a number. It's somewhere in the Help...Object Model Viewer, and don't ask me how they decided that.) then