
Daniel Sterchi
Enthusiast
Daniel Sterchi
Enthusiast
Activity
‎Dec 22, 2017
01:15 AM
1 Upvote
I would make another account on your MBP und try it there. If it works then there is a problem with your account. I would go to ~/Libraries/Application support and rename or remove everything concerning InDesign or even CC. If it does not work, there is a second cache for the MBP I would try to delete this cache as well.
... View more
‎Dec 20, 2017
11:53 AM
Hi ronjaw Try to delete the Cache of the MBP. After that clear the preferences once more. Kind regards Daniel (from Switzerland)
... View more
‎Dec 01, 2017
05:16 AM
Hi timk33859097 Which panel is missing? kind regards Daniel (from Switzerland)
... View more
‎Nov 27, 2017
01:12 AM
Hi Liphou You get into the «Editormode» by pressing <CMD><y>, when you are inside a Textframe. kind regards Daniel (from Switzerland)
... View more
‎Jun 19, 2017
10:13 AM
Hello Roy Marshall I guess you in the wrong forum. The topics here are around Adobe InDesign Scripting. kind regards Daniel (from Switzerland)
... View more
‎Feb 22, 2017
12:03 AM
I guess you tried to «optimize» the catalog? (file - optimize catalog) (so shown on a Mac) Kind regards Daniel (from Switzerland)
... View more
‎Feb 19, 2017
07:06 AM
1 Upvote
Hi DeanB I would try to delete the caches and if this doesn't help delete the preferences. Before you delete the preferences I would make a copy of them. On the mac you find the preferences if you go: -> Start InDesign - Window - Utilities - Scripts There you marke «user» then from the flyout menu you choose «reveal in finder». Then you close InDesign After that you go back two or three directories in the finder and rename the preferences. Hope that hekps kind regards Daniel (from Switzerland)
... View more
‎Feb 16, 2017
04:16 PM
1 Upvote
Hi yaqbpl Is the facedetection activated? If yes try to switch that off. kind regards Daniel (from Switzerland)
... View more
‎Dec 22, 2016
06:35 AM
Yes, but I don't see anything suspicious. Did you try to delete the cache files? Daniel
... View more
‎Dec 22, 2016
02:02 AM
Hi Bente I suppose you are using Windows. If so, which version? Did you look where the catalog is stored if there are files with strange names. E.G. beginning with a tilde or so? kind regards Daniel (from Switzerland)
... View more
‎Nov 01, 2016
06:15 AM
Hi akiva_atwood Short answer: no… First you need to have a open document. Then you can place a spreadsheet which creates a table inside a text frame. Then you can get the data of a specific field. A bit of code: main(); exit(); function main() { // take the open document var myDoc = app.activeDocument; // take the first textframe in my example var myTextFrame = myDoc.textFrames[0]; // take the first table of the first textframe. A table lives inside a textframe var myTable = myTextFrame.tables[0]; // get the data from the cell (1,3) var myData = myTable.columns[1].cells[2].contents; // write the data to the console $.writeln(myData); } I hope this helps to answer your question kind regards Daniel (from Switzerland)
... View more
‎Oct 20, 2016
05:14 AM
1 Upvote
Hi aliceell What about this few lines var myDoc = app.activeDocument; var headers = myDoc.xmlElements[0].evaluateXpathExpression("Page/Table/Table/Header"); // start from the last Element for (var i = headers.length -1; i >= 0; i--) { headers.untag(); } kind regards Daniel (from Switzerland)
... View more
‎Oct 19, 2016
05:31 AM
Hello fee1968 Give this code a try… kind regards Daniel (from Switzerland) main(); exit(); function main() { var myDoc = app.activeDocument; if (myDoc != null) { $.writeln("Colors"); // shows all colors also those whithout a name (then the name is empty) for (var i = 0; i < myDoc.colors.length; i++) { $.writeln(">" + myDoc.colors.name + "<"); } $.writeln("Swatches"); for (var i = 0; i < myDoc.swatches.length; i++) { $.writeln(myDoc.swatches.name); } var unusedSwatches = myDoc.unusedSwatches; $.writeln("\nunused Swatches: " + unusedSwatches.length); for (var i = unusedSwatches.length -1; i >= 0; i--) { $.write(unusedSwatches.name); unusedSwatches.remove(); $.writeln(" deleted"); } } }
... View more
‎Sep 20, 2016
12:29 AM
Hi jakec88782761 geometricBound is an array itself. The entries in the array are (y1, x1, y2, x2). Yes the array starts with y not x, historical reasons. Wo what you want to test is … geometricBounds[1] … kind regards Daniel (from Switzerland)
... View more
‎Oct 14, 2015
04:45 AM
Hi newtoindesign Give this a try. You may have to refine it further.
main();
exit();
function main() {
var myDoc = app.activeDocument;
var myLinks = myDoc.links.everyItem().getElements();
for(var i = 0; i < myLinks.length; i++) {
// parent = e.g. imported Page
// parent.parent = rectagle
// parent.parent.parentPage is a page or null
if (myLinks.parent.parent.parentPage != null) alert("I am on a page");
else alert("I am not on a page");
}
}
kind regards Daniel (from Switzerland)
... View more
‎Aug 16, 2015
06:20 AM
Hi aviR Can you explain a little more. Do you read the tags from an XML-File? Or do you want to create an XML-structure from a text-File? What is your final goal? kind regards Daniel (from Switzerland)
... View more
‎Jun 25, 2015
09:09 AM
Hi machipot I use Oxygen on the mac. It cots a bit but its worth it. kind regards Daniel (from Switzerland)
... View more
‎Jun 17, 2015
01:24 PM
if I get that right you choose text frames manually and apply an action_1. All the text frames on which you didn't apply action_1, action_2 has to be applied. Is that correct? If this is correct one can solve the problem with two little (it depends on what you want to do) JavaScrips. You could select text frames then run JavaScript_1. If all the frames that action_1 should be applied are done, then you can run a second JavaScript that tackles the other action. kind regards Daniel (from Switzerland)
... View more
‎Jun 12, 2015
08:20 AM
Hi Gothamite Is there a rule which text frames should be what? One possibility is that you select text frames, then call a JavaScript, select the next few text frames and so on. kind regards Daniel (from Switzerland)
... View more
‎Jun 09, 2015
05:31 AM
Hi kajzica The error which is seen on your screenshot is not just a missing font. It is a real error which prevents the script from going on. I guess that there is a problem with one of the files. if you open a file from within InDesign it then will become the activeDocument. So you may write
var scource_doc = app.activeDocument;
instead of
var source_doc = app.documents.item(source_file.name);
But that is not the problem. Every InDesign file has at least one page. So there must be an other error. I guess with one of the files in your array. kind regards Daniel (from Switzerland)
... View more
‎Jun 04, 2015
09:50 AM
Hi sreekarthik.k@gmail.com If you export an InDesign document to pdf. Go to «marks & bleeds» there check «page information». Is it that what you want? Otherwise it can be scripted. kind regards Daniel (from Switzerland)
... View more
‎May 29, 2015
03:33 PM
Hi cbishop01 Do you have an example of what you want to achieve (screenshots)? kind regards Daniel (from Switzerland)
... View more
‎May 27, 2015
12:48 PM
Hi sketcg Did you get it to work? Found the problem? kind regards Daniel (from Switzerland)
... View more
‎May 26, 2015
03:13 AM
Hi sketcg This is a much smaller variation of the code which also works. It is also faster as the first one. kind regards Daniel (from Switzerland)
/*
* written by Daniel Sterchi moonsoft.ch GmbH
*/
main();
exit();
function main() {
if (app.documents.length > 0) {
const delimiter = "/";
// the active document
var myDoc = app.activeDocument;
// get all the links of this document
var oldLinks = myDoc.links.everyItem().getElements();
// if there are any links
if (oldLinks.length > 0) {
// open a dialog
var newPath = new Folder(oldLinks[0].filePath).selectDlg("Choose a directory").fullName;
// traverse the array and relink
for (var i = 0; i < oldLinks.length; i++) {
var newFile = File(newPath + delimiter + oldLinks.name);
oldLinks.relink(newFile);
}
}
else alert("Information\nThis document has no links");
}
else alert("Warning\nNo document open");
alert("Information\nI have done my job, what about yours");
}
... View more
‎May 26, 2015
01:59 AM
Hi Vamitul The problem with the mac is that have HFS+ and UFS. I have to make sure that the old path and the new path are in the same format. Otherwise you have something like newpath UFS: "/Users/…" oldPath HFS+ "Macintosh HD:Users:USERNAME:directory I just could do some tests on windows. Here is what I get for Mac and here what I get from Windows Based on what I just saw i would change the script from:
var newPath = new Folder(oldLinks[0].filePath).selectDlg("Choose a directory").fsName;
to:
var newPath = new Folder(oldLinks[0].filePath).selectDlg("Choose a directory").fullName;
kind regards Daniel (from Switzerland)
... View more
‎May 25, 2015
10:20 PM
Hi sketcg What the error message is telling you is, that there is a quotation mark missing at line 24 or above. And actually it is a JavaScript script 😉 Can you provide us the changed script, then I can tell you what goes wrong. kind regards Daniel (from Switzerland)
... View more
‎May 25, 2015
04:01 PM
Hi Brett Thats good news. I just don't have windows so I can't test it. Thanks for your input. Daniel (from Switzerland)
... View more
‎May 25, 2015
01:16 PM
Hi sketcg I have put together a few lines. Try them if the meet your needs. Would like to hear what you think. kind regards Daniel (from Switzerland)
/*
* written by Daniel Sterchi moonsoft.ch GmbH
*/
main();
exit();
function main() {
if (app.documents.length > 0) {
const delimiter = "/"; // "/" for mac "\\" for windows at lieast I think so (have a mac)
// the active document
var myDoc = app.activeDocument;
// get all the links of this document
var oldLinks = myDoc.links.everyItem().getElements();
// if there are any links
if (oldLinks.length > 0) {
// open a dialog
var newPath = new Folder(oldLinks[0].filePath).selectDlg("Choose a directory").fsName;
for (var i = 0; i < oldLinks.length; i++) {
// to get the filename of the Link.
// for windows you can use the folowing code
// var myFileName = oldLinks.filePath;
// myFileName = myFileName.substr(myFileName.lastIndexOf(delimiter) + 1, myFileName.length);
// var newFile = File(newPath + delimiter + myFileName);
// This way you dont have to bother with HFS+ or UFS directory names with macs
var oldFile = File(oldLinks.filePath);
var newFile = File(newPath + delimiter + oldFile.name);
oldLinks.relink(newFile);
}
}
else alert("Information\nThis document has no links to pictures");
}
else alert("Warning\nNo document open");
alert("Information\nI have done my job, what about yours");
}
... View more
‎May 15, 2015
04:11 PM
For the multiple styles replace
if (myParaSel.appliedParagraphStyle == myDoc.paragraphStyles.item("Test") ) {
myParaSel.clearOverrides();
}
with
switch (myParaSel.appliedParagraphStyle) {
case myDoc.paragraphStyles.item("Test"): ;
case myDoc.paragraphStyles.item("Test1"): ;
case myDoc.paragraphStyles.item("…"): ;
// and so on
myParaSel.clearOverrides();
}
If you want to find paragraphs in an table try the following lines I only changed it for one function
function doitWithAllParagraphs() {
var myDoc = app.activeDocument;
if (myDoc != null) {
var paras = myDoc.stories.everyItem().paragraphs.everyItem().getElements();
// you have to test if there is any table
if (myDoc.stories.everyItem().tables.length > 0) {
var paras = myDoc.stories.everyItem().tables.everyItem().cells.everyItem().paragraphs.everyItem().getElements();
for (var i = 0; i < paras.length; i++) {
myParaSel = paras;
switch (myParaSel.appliedParagraphStyle) {
case myDoc.paragraphStyles.item("Test"): ;
case myDoc.paragraphStyles.item("Test1"): ;
myParaSel.clearOverrides();
}
}
} // for the for loop
else alert("Information\nNot Table found");
}
}
... View more
‎May 15, 2015
02:08 PM
Hi mikej3204 I've put together a few lines. Try them and see if they work for you. kind regards Daniel (from Switzerland)
main();
exit();
// needs some refinement to fit your needs
function main() {
// try it with both functions
// doitWithSelection();
doitWithAllParagraphs();
alert("Information\nI've done my job, what about yours");
}
// 1. Select a paragraph (click 4 times into text)
// .2 start the program
function doitWithSelection() {
var myDoc = app.activeDocument;
if (myDoc != null) {
var myParaSel = myDoc.selection[0];
if (myParaSel.constructor.name == "Paragraph") {
// you have to change the "Test" with your paragraphstyle where you want to clear all overrides
if (myParaSel.appliedParagraphStyle == myDoc.paragraphStyles.item("Test") ) {
myParaSel.clearOverrides();
}
}
else {
alert("Information\nNo paragraph selected");
}
}
}
function doitWithAllParagraphs() {
var myDoc = app.activeDocument;
if (myDoc != null) {
var paras = myDoc.stories.everyItem().paragraphs.everyItem().getElements();
for (var i = 0; i < paras.length; i++) {
myParaSel = paras;
// you have to change the "Test" with your paragraphstyle where you want to clear all overrides
if (myParaSel.appliedParagraphStyle == myDoc.paragraphStyles.item("Test") ) {
myParaSel.clearOverrides();
}
} // for the for loop
}
}
... View more