lfcorullon
Enthusiast
lfcorullon
Enthusiast
Activity
‎Dec 12, 2024
07:19 AM
Thanks anyway. I tried app.refresh, thumbnail.refresh, doc.refresh... none of them looks to really work. The $.sleep() is an option, but it could get too long when processing lots of images.
... View more
‎Dec 11, 2024
05:49 AM
Ok. I'm sorry but I can't share the full code. I just want to know if there is a way to make Bridge wait the completion of a process before to start a new one... RUN function 1 and WAIT to the completion. RUN function 2 and WAIT to the completion. Then RUN function 3 and FINISH.
... View more
‎Dec 10, 2024
01:59 PM
I don't think it'll help. My scenario is very particular. I have three functions: function rotate() {
/*compare the width and height and rotate vertical image counterclockwise*/
}
function move() {
/*it creates a folder and move each thumbnail to one new folder.
if 15 thumbnails, then 15 folders will be created, numbered, to move each thumb to its folder*/
}
function rename() {
/*rename some files that are previously moved to a new folder*/
} And I think this is the problem. Bridge doesn't wait the folder creation and the files to be moved to start the next function. When it starts, no folders are created yet.
... View more
‎Dec 09, 2024
07:18 PM
Hello, there. Let's see if anybody can help... I have a Bridge script that renames and move the visibleThumbnails to new folders. Easy like this: I have 15 visibleThumbnails, then the script will creates 15 folders and move each visibleThumbnail to its own folder. BUT... I need another function to run over the new created folders. This another function is being called after the loop that create the folders. But this another function never runs unless I put an alert at its beginning. Any help?
... View more
‎Nov 21, 2024
01:06 PM
Thank you so much. This is not in the any documentation I have access.
... View more
‎Nov 15, 2024
11:20 AM
Can anybody help? I need to get stacks from thumbnails in Bridge. I have lots of images, some stacked, and I can't find a way, in scripting DOM, to know if that thumbnail is part of a stack. I can get the files if I loop thru app.document.stacks. But I can't get the stacks from the thumbnails. Is it even possible?
... View more
‎Jul 10, 2024
08:24 AM
Great. Will all the problems of trim, bleed, etc be avoided using this option?
... View more
‎Jul 09, 2024
04:13 PM
Hello, how can I accomplish the same I'm doing mnually (in the link below), using javascript? https://youtu.be/afsloq5D_RU I tried the following code, but the right pages doesn't move. var doc = app.activeDocument;
var sp = app.activeWindow.activeSpread;
var p1 = sp.pages[0];
var p2 = sp.pages[1];
sp.allowPageShuffle = false;
p2.move(LocationOptions.AFTER , sp , BindingOptions.RIGHT_ALIGN); Thanks in advance.
... View more
‎Jul 23, 2023
03:13 PM
First of all, thank you so much for the master class, @Marc Autret. You're really awesome and I am so thanfull for your time!!! The suggestion 1 apparently solved the problem. I'm testing it right now and making some improvements to the code. Thanks again!!!
... View more
‎Jul 19, 2023
09:26 PM
Just toggle the lines 2 and 3 (toggle the comment to run directly line 2 or line 3). Running from line 2 doesnt' show the scrollbar while adding lines. Running from line 3, does show the scrollbar while adding lines. PS: in CS6 both runs fine. //========================================================================================
var data = myW();
//~ myNW();
//========================================================================================
//========================================================================================
function myW() {
var wo = new Window("dialog");
var go = wo.add("group");
go.orientation = "column";
go.alignment = ["fill" , "fill"];
var p1o = go.add("panel" , undefined , "");
p1o.orientation = "row";
p1o.alignment = ["fill" , "fill"];
p1o.alignChildren = "fill";
p1o.margins.top = (p1o.text != "") ? 20 : 10;
var b3 = p1o.add("button" , [0,0,75,24] , "New");
b3.enabled = true;
//========================================================================================
var btns = wo.add("group");
btns.alignment = "center";
btns.alignChildren = "center";
btns.add("button" , undefined , "OK");
btns.add("button" , undefined , "Cancel");
//========================================================================================
b3.onClick = function () {
wo.close(2);
myNW();
}
//========================================================================================
//========================================================================================
if (wo.show() != 2) alert("OK main window");
else exit();
}
//========================================================================================
//========================================================================================
//========================================================================================
function myNW() {
var nw = new Window("dialog");
var pFix = nw.add("panel" , undefined , "");
pFix.orientation = "row";
pFix.minimumSize.width = pFix.preferredSize.width = pFix.maximumSize.width = 300;
pFix.alignChildren = "left";
pFix.margins.top = 20;
pFix.maximumSize.height = 210;
//========================================================================================
var np1 = pFix.add("group");
np1.orientation = "column";
np1.alignment = "fill";
np1.alignChildren = "left";
np1.margins.bottom = 20;
np1.maximumSize.height = 999999;
//========================================================================================
var ng2 = np1.add("group");
ng2.orientation = "column";
ng2.minimumSize.width = ng2.preferredSize.width = ng2.maximumSize.width = 284;
ng2.alignment = "fill";
ng2.alignChildren = "left";
var ng2_row = ng2.add("group");
ng2_row.orientation = "row";
var dname = ng2_row.add("statictext" , [0,0,140,22] , "Line");
var dadd = ng2_row.add("button" , [0,0,20,20] , "+");
dadd.onClick = function () {
gg = ng2;
gg.ng = gg.add("group");
gg.fname = gg.ng.add("statictext" , [0,0,140,22] , "New line");
gg.btn = gg.ng.add("button" , [0,0,20,20] , "-");
gg.btn.onClick = remRow;
n = ng2.children.length + 1;
v = np1.location.y;
nw.layout.layout(true);
np1.size.height = (ng2.children.length)*32;
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.minvalue = -20;
scrollBar.maxvalue = np1.size.height - pFix.size.height + 20;
np1.location.y = v;
}
//========================================================================================
var scrollBar = pFix.add("scrollbar");
scrollBar.stepdelta = scrollBar.jumpdelta = 10;
scrollBar.preferredSize.width = 16;
scrollBar.preferredSize.height = 208;
scrollBar.value = 0;
scrollBar.minvalue = 0;
scrollBar.maxvalue = 0;
//========================================================================================
scrollBar.onChanging = function () {
np1.location.y = -1 * this.value;
}
//========================================================================================
nw.onShow = function () {
np1.maximumSize.height = (ng2.children.length)*1000;
np1.maximumSize.width = pFix.size.width-30;
scrollBar.size.width = 14;
scrollBar.size.height = 208;
scrollBar.location = [pFix.size.width-18 , 0];
}
//========================================================================================
function remRow() {
this.parent.parent.remove(this.parent);
n = ng2.children.length + 1;
v = np1.location.y;
nw.layout.layout(true);
np1.size.height = (ng2.children.length)*32;
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.minvalue = -20;
scrollBar.maxvalue = np1.size.height - pFix.size.height + 20;
scrollBar.value -= 32;
np1.location.y = v;
if (np1.size.height > pFix.size.height && np1.bounds.bottom < pFix.bounds.bottom-20) {
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.maxvalue = np1.size.height - pFix.size.height + 20;
np1.location.y = (v+32);
}
if (np1.size.height <= pFix.size.height-20) {
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.maxvalue = np1.size.height - pFix.size.height + 20;
np1.location.y = 20;
}
}
//========================================================================================
var nbtns = nw.add("group");
nbtns.alignment = "center";
nbtns.alignChildren = "center";
var myOK = nbtns.add("button" , undefined , "OK");
var myCancel = nbtns.add("button" , undefined , "Cancel");
//========================================================================================
if (nw.show() != 2) alert("OK new dialog");
else exit();
}
//========================================================================================
//========================================================================================
... View more
‎Jul 19, 2023
06:27 PM
@Marc Autret any thoughs on this? The second window is a function. If I call it from within another function (even a button.onClick = function () {}) the scrollbar doesn't show. This is driving me crazy. I have no idea anymore. Tried all I can. Thanks in advance.
... View more
‎Jul 17, 2023
06:48 PM
1 Upvote
If you want to override all pageItems from master to each page, you can loop thru each page's masterPageItems. var doc = app.activeDocument;
var pgs = doc.pages;
for (var i=0; i<pgs.length; i++) {
var pg = pgs[i];
var mpitems = pg.masterPageItems;
for (var j=0; j<mpitems.length; j++) {
mpitems[j].override(pg);
}
}
... View more
‎Jul 17, 2023
05:42 PM
Your indexes are wrong. You need to start from 0. So, page 1, if it's the first page in the document, is doc.pages.item(0). Or simple doc.pages[0]. var doc = app.activeDocument
doc.spreads.item(0).appliedMaster = doc.masterSpreads.item("A-Parent");
var myTextFrame = doc.masterSpreads.item(0).pages.item(1).textFrames.item(0).override(doc.pages.item(0));
myTextFrame.insertionPoints.item(0).contents = "Hello Override!";
... View more
‎Jul 16, 2023
01:10 PM
If I open this Windows from within another function, the scrollbar misses. If I run it from outside a function, it runs fine.
... View more
‎Jul 16, 2023
12:20 PM
Yes. I tried the layout.layout() in every container (from the main one - the window) to the nearest one (the group). The script already has the layout.layout to the window. When I run it directly, everything works. The progressbar only misses when this window is started from the previous window.
... View more
‎Jul 15, 2023
01:15 PM
1 Upvote
I'm working, one more time, in a scrollable panel. The script consists in two windows. One which is the main/load. One which is the new/edit. I made both in a separate jsx file first. If I run the second one (new/edit) directly, everything is fine. When I add its code to the main one, to run it when a button is pressed, the scrollbar is missing, as you can see in this small video I made to show. Any ideas? I checked both codes more than twice. No variable names problems, nothing I can find. Thanks in advance.
... View more
‎Jul 14, 2023
09:37 PM
Same here. I can't get it to work.
... View more
‎Jul 14, 2023
05:19 PM
I'm working in a script to convert some files and, after the convertion, the folder has no thumbs to display (but Windows Explorer shows everything ok). If I manually go to the Tools > Cache > Purge cache to this Folder, it works. But I need this working in my script. Any help will be appreciated. Thanks in advance.
... View more
‎Jul 14, 2023
04:58 PM
Hello, there. I'm working in a script to convert some files. While converting, those files are loosing the metadata. So, I export the metadata from the original file, convert, import the metadata to the new file and then Bridge is stopping with the message below: "Unable to multiply transform. GDI Status: "InvalidParameter". I really don't know what about this message is. If I manually go to Tools > Cache > Purge Cache for Folder... The error is shown one more time and the folder is "restored". I mean restored because if I don't manually purge the cache, Bridge can't "read" this folder anymore (but in Windows Explorer the folder is OK and the all files are there). Both original, the converted one and the txt file where I stored the metadata temporarily. Any help on how I can purge the cache, like manually described, will be much appreciated. I tried the ManageCache from the Adobe Documentation, but the object doesn't have a constructor. MY MAIN GOAL: convert files and then import the metadata from a txt file (because the converted files looses the metadata).
... View more
‎Apr 18, 2023
11:01 AM
//=============================================================
// Script by Luis Felipe Corullón
// Contato: lf@corullon.com.br
// Site: http://scripts.corullon.com.br
// +55 (51) 9-9685.7565
// Version: 20230418_1458_GMT-3
//=============================================================
var doc = app.activeDocument;
var msp = doc.masterSpreads.everyItem().name;
var ps = doc.paragraphStyles.everyItem().name;
var data;
msp.unshift("Master to apply");
var w = new Window("dialog" , "Script by LFCorullón");
w.alignChildren = "left";
var g = w.add("group");
g.orientation = "column";
var pFix = g.add("panel" , undefined , "Scrollable");
pFix.orientation = "row";
pFix.alignment = "fill";
pFix.alignChildren = "right";
pFix.margins.top = 20;
pFix.maximumSize.height = 200;
var p1 = pFix.add("group");
p1.orientation = "column";
p1.alignment = "fill";
p1.alignChildren = "right";
p1.margins.bottom = 20;
p1.maximumSize.height = 999999;
var gParaStyle = p1.add("group");
gParaStyle.orientation = "column";
gParaStyle.alignChildren = "right";
var g2 = gParaStyle.add("group");
g2.orientation = "row";
g2.alignChildren = "center";
var dParaStyle = g2.add("checkbox" , undefined , "Paragraph style");
var dParaStyle_sel = g2.add("dropdownlist" , [0,0,100,22] , ps);
var dParaStyle_msp = g2.add("dropdownlist" , [0,0,120,22] , msp);
dParaStyle.value = dParaStyle_sel.enabled = dParaStyle_msp.enabled = false;
dParaStyle_msp.selection = 0;
dParaStyle_msp.helpTip = "\"Master to apply\" option will apply the [None] master page";
var dParaStyle_btns = g2.add("group");
dParaStyle_btns.spacing = 5;
var dParaStyle_plus = dParaStyle_btns.add("button" , [0,0,20,20] , "+");
dParaStyle_plus.enabled = false;
dParaStyle_plus.onClick = function () {
addRow(gParaStyle , "Paragraph style" , ps , this);
}
var scrollBar = pFix.add("scrollbar");
scrollBar.size = [14 , 190];
scrollBar.stepdelta = scrollBar.jumpdelta = 10;
scrollBar.value = 0;
scrollBar.minvalue = 0;
scrollBar.maxvalue = 0;
scrollBar.onChanging = function () {
p1.location.y = -1 * this.value;
}
dParaStyle.onClick = function () {
if (this.value == true) {
dParaStyle_sel.enabled = dParaStyle_msp.enabled = dParaStyle_plus.enabled = true;
dParaStyle_sel.enabled = dParaStyle_plus.enabled = true;
}
else {
dParaStyle_sel.enabled = dParaStyle_msp.enabled = dParaStyle_plus.enabled = false;
if (gParaStyle.children.length > 1) {
for (var i=gParaStyle.children.length-1; i>=1; i--) {
gParaStyle.remove(gParaStyle.children[i]);
w.layout.layout(true);
p1.size.height = (gParaStyle.children.length)*32;
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.minvalue = -20;
scrollBar.maxvalue = p1.size.height - pFix.size.height + 20;
}
}
dParaStyle_sel.selection = null;
}
}
//========================================================================================
//========================================================================================
function addRow(group , style , array , btn) {
gg = group.add("group");
gg.alignChildren = "top";
gg.check = gg.add("statictext" , undefined , style);
gg.ps = gg.add("dropdownlist" , [0,0,100,22] , array);
gg.msp = gg.add("dropdownlist" , [0,0,120,22] , msp);
gg.msp.selection = 0;
gg.msp.helpTip = "\"Master to apply\" option will apply the [None] master page";
gg.btns = gg.add("group");
gg.btns.spacing = 5;
gg.btns.minus = gg.btns.add("button" , [0,0,20,20] , "-");
gg.btns.minus.onClick = remRow;
w.maximumSize.width = wW;
w.center();
n = gParaStyle.children.length + 1;
v = p1.location.y;
w.layout.layout(true);
p1.size.height = (gParaStyle.children.length)*32;
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.minvalue = -20;
scrollBar.maxvalue = p1.size.height - pFix.size.height + 20;
p1.location.y = v;
}
//========================================================================================
//========================================================================================
function remRow() {
this.parent.parent.parent.remove(this.parent.parent);
w.maximumSize.width = wW;
w.center();
n = gParaStyle.children.length + 1;
v = p1.location.y;
w.layout.layout(true);
p1.size.height = (gParaStyle.children.length)*32;
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.minvalue = -20;
scrollBar.maxvalue = p1.size.height - pFix.size.height + 20;
scrollBar.value -= 32;
p1.location.y = v;
if (p1.size.height > pFix.size.height && p1.bounds.bottom < pFix.bounds.bottom-20) {
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.maxvalue = p1.size.height - pFix.size.height + 20;
p1.location.y = (v+32);
}
if (p1.size.height <= pFix.size.height-20) {
scrollBar.location = [pFix.size.width-18 , 0];
scrollBar.maxvalue = p1.size.height - pFix.size.height + 20;
p1.location.y = 20;
}
}
//========================================================================================
//========================================================================================
//========================================================================================
//========================================================================================
w.onShow = function () {
wW = w.frameBounds.width;
p1.maximumSize.height = (gParaStyle.children.length)*1000;
scrollBar.location = [pFix.size.width-18 , 0];
}
//========================================================================================
//========================================================================================
//========================================================================================
//========================================================================================
if (w.show() != 2) {
var ps_selections = [];
if (dParaStyle.value == true) {
for (var i=0; i<gParaStyle.children.length; i++) {
var ps_name = gParaStyle.children[i].children[1].selection.text;
var ps_msp = gParaStyle.children[i].children[2].selection.text;
ps_selections.push([ps_name , ps_msp]);
}
}
data = ps_selections;
}
else exit();
//========================================================================================
//========================================================================================
... View more
‎Feb 27, 2023
11:53 AM
Weird. Thanks too, Brian, for test it and letting me know.
... View more
‎Feb 27, 2023
11:52 AM
Yes, I tried running from ESTK and from Scripts Panel. Same weird behavior. Thanks for trying help.
... View more
‎Feb 25, 2023
01:34 PM
Very weird. I'm on same InDesign version. Windows. Look my result:
... View more
‎Feb 25, 2023
08:39 AM
Both colors "verde" and "amarelo" are the problematic ones. Same value, different names. Now they are duplicated outside the groups. Very weird. app.doScript(main, ScriptLanguage.javascript, undefined, UndoModes.entireScript, "change swatches by group");
//========================================================================================
//========================================================================================
function main() {
var doc = app.activeDocument;
var a = doc.colorGroups.itemByName("a");
var b = doc.colorGroups.itemByName("b");
changeSw(doc,a,b);
alert("Done." , "Script by LFCorullón");
}
//========================================================================================
//========================================================================================
function changeSw(doc,a,b) {
app.findChangeColorOptions.includeFootnotes = true;
app.findChangeColorOptions.includeHiddenLayers = true;
app.findChangeColorOptions.includeLockedLayersForFind = true;
app.findChangeColorOptions.includeLockedStoriesForFind = true;
app.findChangeColorOptions.includeMasterPages = true;
app.findChangeColorOptions.objectType = ObjectTypes.ALL_FRAMES_TYPE;
var match = [];
for (var i=0; i<a.colorGroupSwatches.length; i++) {
var swa = a.colorGroupSwatches[i].swatchItemRef;
var aname = swa.name;
var anmreg = aname.replace(/^.+?_/,"").replace(/\scopy$/gi,"");
for (var j=0; j<b.colorGroupSwatches.length; j++) {
var swb = b.colorGroupSwatches[j].swatchItemRef;
var bname = swb.name;
if ( RegExp(anmreg,"i").test(bname) ) match.push([swa,swb]);
}
}
for (var i=0; i<match.length; i++) {
a = match[i][0];
b = match[i][1];
if (a.isValid && b.isValid) {
app.findColorPreferences = app.changeColorPreferences = NothingEnum.NOTHING;
app.findColorPreferences.findWhat = a;
app.findColorPreferences.tintLowerLimit = 0;
app.findColorPreferences.tintUpperLimit = 100;
app.changeColorPreferences.changeTo = b;
doc.changeColor();
app.findColorPreferences = app.changeColorPreferences = NothingEnum.NOTHING;
}
}
}
//========================================================================================
//======================================================================================== Thanks for trying to help, @brian_p_dts and @Laubender
... View more
‎Feb 25, 2023
08:37 AM
Even with the fix, it's still buggy. Now the behavior changed: the colors are duplicated outside the groups.
... View more
‎Feb 24, 2023
05:35 PM
Hello, @brian_p_dts. I'm trying some options and none is working. I also tryied manually and an object (rectangle) with manual applied color (not by style), doesn't change. Is this feature bugged in 2023? Both colors are inside groups (find color in group "a", change color in group "b"). The dialog alerts the change (manual operation) but the color is not effectivelly changed. Any idea? var doc = app.activeDocument;
var a = doc.colorGroup.itemByName("a");
var b = doc.colorGroup.itemByName("b");
changeSw(doc,a,b)
function changeSw(doc,a,b) {
app.findChangeColorOptions.includeFootnotes = true;
app.findChangeColorOptions.includeHiddenLayers = true;
app.findChangeColorOptions.includeLockedLayersForFind = true;
app.findChangeColorOptions.includeLockedStoriesForFind = true;
app.findChangeColorOptions.includeMasterPages = true;
app.findChangeColorOptions.objectType = ObjectTypes.ALL_FRAMES_TYPE;
var match = [];
for (var i=0; i<a.colorGroupSwatches.length; i++) {
var swa = a.colorGroupSwatches[i].swatchItemRef;
var aname = swa.name;
var anmreg = aname.replace(/^.+?_/,"");
for (var j=0; j<b.colorGroupSwatches.length; j++) {
var swb = b.colorGroupSwatches[j].swatchItemRef;
var bname = swb.name;
if ( RegExp(anmreg,"i").test(bname) ) match.push([swa,swb]);
}
}
for (var i=0; i<match.length; i++) {
a = match[i][0];
b = match[i][1];
if (a.isValid && b.isValid) {
app.findColorPreferences = app.changeColorPreferences = NothingEnum.NOTHING;
app.findColorPreferences.findWhat = a;
app.findColorPreferences.tintLowerLimit = 0;
app.findColorPreferences.tintUpperLimit = 100;
app.changeColorPreferences.changeTo = b;
doc.changeColor();
app.findColorPreferences = app.changeColorPreferences = NothingEnum.NOTHING;
}
}
}
... View more
‎Oct 23, 2022
12:54 PM
1 Upvote
A new fresh installation of Windows 11 solved the problem... =/
... View more
‎Oct 23, 2022
09:48 AM
Didn't work. I'm reinstalling Windows right now.
... View more
‎Oct 23, 2022
08:31 AM
For me, both cases fails.
... View more
‎Oct 22, 2022
03:25 PM
I'm on Win11 22H2 22621.675
... View more