Copy link to clipboard
Copied
Does anyone have any tips on how to remove all guides in the script?
app.project.item(index).removeGuide(guideIndex)
What should be in the parentheses to remove multiple guides at once.
Who I use for loop for example
for (i = 0; i < 250; i++){
comp.removeGuide(i);
}
It removes guides but in some weird groups so I need to click multiple times to be able to delate all of them.
Thank you in advance.
if you do
comp.removeGuide(0);
instantly after that call, guide 1 becomes guide 0.
Hence, if you do
comp.removeGuide(1);
after that, you miss the guide, which has just become guide 0
try something like
var num = comp.guides.length;
for (i = 0; i < num; i++){
comp.removeGuide(0);
}
Copy link to clipboard
Copied
if you do
comp.removeGuide(0);
instantly after that call, guide 1 becomes guide 0.
Hence, if you do
comp.removeGuide(1);
after that, you miss the guide, which has just become guide 0
try something like
var num = comp.guides.length;
for (i = 0; i < num; i++){
comp.removeGuide(0);
}
Copy link to clipboard
Copied
That is great. Thank you so much, Mathias.
Copy link to clipboard
Copied
... and by the way, if you use Automation Blocks, you don't even need a loop to remove all guides:
Copy link to clipboard
Copied
Automation Blocks is a wonderful tool. Thank you again, Mathias.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more