
Loic.Aigon
People's Champ
Loic.Aigon
People's Champ
Activity
‎Aug 30, 2024
02:41 PM
1 Upvote
Indeed, GIFStudio is a possibility for exporting GIF out of InDesign. @Monika Gause did a series of nice use cases. She uses Illustrator but the Extension works for both InDesign and Illustrator. https://www.youtube.com/watch?v=BI5RyvNhtPI&list=PLVqhHu3CSohVJWaOBO9HVKXcEgbfsXKK4 https://www.youtube.com/watch?v=dZ2s7tpSOP0&list=PLVqhHu3CSohVJWaOBO9HVKXcEgbfsXKK4&index=6 https://www.youtube.com/watch?v=hBqyU6VmefY&list=PLVqhHu3CSohVJWaOBO9HVKXcEgbfsXKK4&index=8 More can be found here: https://www.ozalto.com/produits/gifstudio/
... View more
‎Nov 14, 2023
01:47 PM
To send messages between panels, you may need Vulcan.js library: https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_11.x/Vulcan.js See Vulcan.prototype.dispatchMessage for ex You would need one Vulcan instance listening in Panel A and one Vulcan instance to dispatch event in panel B.
... View more
‎Sep 06, 2023
01:18 PM
Almost everything is feasible. But I don't think you can create Datamerge Placeholders without loading a CSV file first. Besides the DataMergeFields collection doesn't expose an "add" method, which second that point. https://www.indesignjs.de/extendscriptAPI/indesign-latest/#DataMergeFields.html That said, whatever, you will use Datamerge or XML import in a scripted way, it will probably start by manually tagging elements in the layout. Unless you have some deep logic to turn untagged contents to tagged contents. Loic
... View more
‎Sep 06, 2023
01:13 PM
1 Upvote
Have you seen this: https://github.com/twardoch/lorem-chatum-for-indesign Quite likely that you can ask for all of this.
... View more
‎Aug 29, 2023
11:35 AM
2 Upvotes
Looks to me you are just looking at Liquid Layout. https://helpx.adobe.com/fr/indesign/using/alternate-layouts-liquid-layouts.html On top of that there is the collecter that can create linked text references: https://helpx.adobe.com/indesign/using/linked-content.html As for color spaces, work in RGB and if a print file is needed, output it as PDF/X-4 with the specific output intent. https://helpx.adobe.com/fr/indesign/using/exporting-publishing-pdf.html Unless I didn't understand.
... View more
‎Aug 20, 2023
07:32 AM
1 Upvote
I can't really say. When I try to run your code, I get errors far before I get to exporting files. If I may, you could probably simplify your code greatly. For example, getting files (Folder.getFiles()) can use a filter to return indd files exclusively. And as theFiles would be an array, getting how many of them are they is quite easy and require no extra code. You could possibly factorise some UI components but that's not the most critical part. Also, the first modal dialog, you may not want to run your export by the click of the button. But to close Window with a specific integer which is not 0, like close(1). That way, you can easily check if the script was canceled or not at that first stage: if(dialog.show()==1)… Sorry for not helping much on the canceled exports here but i thought it was worrth mentioning. HTH somehow. Loic
... View more
‎Aug 19, 2023
01:57 PM
I am having troubles understanding how you could have used a ScriptUI Window of type palette without a targetengine directive to maintain you palette open. But yes, you have to use this instrcution to keep things persistent. That said, it's hard to say why your script doesn't work without seeing it. Might be a scope issue, at the moment, it's all I can think of.
... View more
‎Aug 17, 2023
10:11 AM
1 Upvote
Ok, so here is a possible approach: #targetengine "session"
var palette = palette || getPalette();
var cancel = false;
palette.show();
var tasks = {};
function exportDoc(w){
var doc = app.documents[0];
if(!doc.isValid) return;
var d = (new Date()).getTime().toString();
var n = 15;
while(n--){
w.t.text = d;
doc.textFrames[0].contents = cancel+":"+d;
var t = doc.asynchronousExportFile(ExportFormat.PDF_TYPE, File(Folder.desktop+"/pdfs/"+n+"_tutu_"+d+".pdf"), false);
tasks[t.id] = t;
}
}
function getPalette(){
var u;
var w = new Window("palette","Testing canceling");
w.size = [200,500];
var exportBtn = w.add("button", u, "Export");
var cancelBtn = w.add("button",u,"Cancel");
var resetBtn = w.add("button",u,"Reset");
exportBtn.onClick = function(){
exportDoc(w);
}
resetBtn.onClick = function(){
cancel=false;
}
cancelBtn.onClick = function(){
cancel=true;
for(prop in tasks){
tasks[prop].cancelTask();
delete tasks[prop];
}
}
w.t = w.add("statictext",u,"…");
w.t.alignment = "fill";
return w;
}
... View more
‎Aug 16, 2023
02:34 PM
1 Upvote
What about your window type? Dialogs are modal by default, you may want ro use non modal duch as palette.
... View more
‎Aug 16, 2023
01:39 PM
2 Upvotes
By default yes if you do export syncronously where you basically freeze the app (it's a modal process). If you use asynchronousExportFile You will have exports done in the background with the app non frozen (non modal). This will create background tasks that you can possibly monitor and "possibly" stop processes (tbh I am not completely sure but that's where I would investigate).
... View more
‎Aug 08, 2023
03:27 PM
1 Upvote
If you want something more "dynamic", you could loop through links and look at if their nalme matches a certain string with your regexp: function main(){
var doc = app.documents.everyItem().getElements();
var n = doc.length;
if(!n){
alert("You need a document");
return;
}
doc = doc[0];
var lks = doc.links.everyItem().getElements(), lk;
n = lks.length;
while(n--){
lk = lks[n];
var numberedFile = File(lk.filePath);
var newFolder = numberedFile.parent;
var linkName = lk.name;
var newLinkName = linkName.replace(/-\d+\.jpg$/, ".jpg");
var newLinkFile = File(newFolder+"/"+newLinkName);
if(/myImage-\d+\.jpg/.test(linkName) && newLinkFile.exists) lk.relink(newLinkFile);
}
}
var u;
app.doScript("main();", u, u, UndoModes.ENTIRE_SCRIPT, "Relink");
... View more
‎Aug 08, 2023
03:20 PM
1 Upvote
You cannot use RegExp there. You need the exact name: var link = app.activeDocuments.itemByName("myImage-1.jpg"); if(link.isValid) lk.relink(new File("/Some/location/to/myImage.jpg");
... View more
‎Aug 08, 2023
02:57 PM
This thread seems similar to your need: https://community.adobe.com/t5/indesign-discussions/multiple-record-merge-directory-records-overlapping/m-p/13993859#M537151
... View more
‎Aug 08, 2023
02:51 PM
See here: https://www.indiscripts.com/post/2010/03/bookbarcode-indesign-ean13-isbn-barcode-manager
... View more
‎Aug 08, 2023
07:38 AM
1 Upvote
Glad I could help.
... View more
‎Aug 08, 2023
01:45 AM
2 Upvotes
Make your "repeating" frame as large as page margins: Then ask for datamerge using unique records. You will get a n pages document where all records stand on one page: Then you need a script to thread all frames. Here is a short one that will work ONLY if the merged document is made of one textframe per pages with no other layout additions (it will be your base content): function main(){
var doc = app.documents.everyItem().getElements();
var n = doc.length;
if(!n){
alert("You need a document");
return;
}
doc = doc[0];
var tfs = doc.pages.everyItem().textFrames.everyItem().getElements();
n = tfs.length;
while(n--){
if(n==0) break;
tfs[n].previousTextFrame = tfs[n-1];
}
}
var u;
app.doScript("main();", u, u, UndoModes.ENTIRE_SCRIPT, "Merge textframes"); You then get all the content as part of a flow: Here you are.
... View more
‎Aug 08, 2023
01:28 AM
2 Upvotes
Can't you just condition your script execution? function routine1(){…} function routine2(){…} function main(){ routine1(); if(condition) return; routine2(); } Never had to use exit() in more than 16 years of scripting
... View more
‎Aug 07, 2023
07:01 AM
Also, could have mentioned this: https://coppieters.nz/?p=549 never used myself and legal concers remain
... View more
‎Aug 07, 2023
04:30 AM
Well if it works… But fontStyle/fontFamily should have worked, probably some UXP weirdness.
... View more
‎Aug 07, 2023
03:51 AM
2 Upvotes
I might be wrong but I don't think you can by the sole construction of an idjs script from an HTML Page. idjs scripts will basically be executed on demand (typically by the user). So your puzzle is missing a piece, i.e. a listener that reacts from the html call and run something. What you can do at the moment is: - Wait for UXP plugins and see if they offer some kind of "webhook" that you can use to activate the idjs script on demand. - Work with CEP plugins. Those can easily set a webhook. But those work typically with ExtendScript. So you could either work with ExtendScript scripts, or have one that will run the idjs script (but the latter I never tried). - Have some process of yours that catches requests and run InDesign from command line: https://stackoverflow.com/questions/37320580/how-to-execute-an-indesign-extendscript-from-command-line but I am not sure that can work with idjs file (nor the whole thing to be frankly honest). - Use some whatever code (VB?) that both can receive http requests and drive InDesign. My personal take at the moment would be the CEP plugin. But be aware you are at legal risk here. If the person that clicks on the HTML page that runs the idjs script is not the InDesign License owner, you are infringing Adobe InDesign's EULA. Or you need InDesign Server.
... View more
‎Aug 07, 2023
03:40 AM
Your script should work in respect to the DOM. Try this, seems too work: doc.paragraphStyles.add({
name: "ps_DOI",
appliedFont:"Myriad Pro Semibold Condensed",
pointSize: "12pt",
ligatures: true,
justification: Justification.LEFT_ALIGN,
minimumWordSpacing: 80,
desiredWordSpacing: 100,
maximumWordSpacing: 133,
spanColumnType: SpanColumnTypeOptions.SINGLE_COLUMN,
fillColor: "Black"
});
... View more
‎Aug 01, 2023
11:36 AM
1 Upvote
Can you try with Javascript to see where the issue resides? If the javascript works fine, then it means the problem is using the XPath with VB.net. Maybe some xpath expressions are not usable in VB.net or you have to tweak something to make it VB.net compliant. Also what you can try is start using simpler xpath and add complexity little by little. There you can see where expression interpretation fails. Cannot help more.
... View more
‎Aug 01, 2023
11:24 AM
1 Upvote
I would rather recommend using the XMP Library: https://extendscript.docsforadobe.dev/scripting-xmp/accessing-the-xmp-scripting-api.html You will find many posts around with samples. HTH Loic
... View more
‎Jul 31, 2023
03:19 PM
2 Upvotes
Ok, so you might have a chance. Once an extension is loaded, it becomes…a panel. And panel has a read/write property "visible". So basically= var p = app.panels.itemByName("the name of my panel");
if(p.isValid){
p.visible=!p.visible;
} Now you need an async routine to make the panel open/close. That can be done with a startup script and an idleEvent Handler: #targetengine "session"
main();
function main(){
var tasks = app.idleTasks;
var name = "RelaunchPanel";
var rate = 5000;
var callback = function(e){
var p = app.panels.itemByName("test 1");
if(p.isValid){
if(p.visible) p.visible = false;
p.visible = true;
}
}
var t = tasks.itemByName(name);
if(t.isValid){
t.eventListeners.everyItem().remove();
t.remove();
}
t = tasks.add({name:name, sleep:rate});
t.addEventListener(IdleEvent.ON_IDLE, callback, false);
} Simply change the panel name, save this snippet as a js(x) file, put it into the startup scripts folder, restart InDesign and you should be fine. Hope that helps, Loic
... View more
‎Jul 29, 2023
03:17 AM
1 Upvote
Not completely true. UXP Plugins are not a thing for sure. But UXP Scripts can allow building UIs, it's just highly limited. https://github.com/AdobeDocs/uxp-indesign/blob/main/src/pages/uxp-scripting-samples/Dialog.idjs
... View more
‎Jul 26, 2023
11:17 AM
I don't need to select ALL PathPoints - I would like to be able to select only some of them - or one of the Paths of the more complicated object By @Robert at ID-Tasker Yes I think I got you right 😉
... View more
‎Jul 26, 2023
10:00 AM
You can only script what's feasible in the UI (the other way around not always true). But in that case, no, you cannot. That said, it's a weird conclusion to me that undo levels would affect your script performance. There are zillions reasons others than this one that could be investigated. An easy way to figure is to run your script in a whole cancelable sequence (only one undo here) var u; app.doScript("myScript(…)",u,u,UndoModes.ENTIRE_SCRIPT, "One undo"); That would discard the undo concern.
... View more
‎Jul 26, 2023
09:55 AM
I think you reached a limit of InDesign. A simple test is UI selecting a point and ask for current selection constructor. While you would expect "PathPoint", you get "Polygon". So basically the concept of selection seems to stop at the pageItem level. Unless I am wrong. Loic
... View more