Skip to main content
dublove
Legend
June 2, 2026
Question

How to use a script to select all guide lines and move them to the “myGuids” layer?

  • June 2, 2026
  • 1 reply
  • 20 views

Hi everyone.

I want to unlock all guides and move them to the “myGuids” layer.
I’ve been searching for information for ages, but haven’t found much.
I used:

var d = app.activeDocument;
var item = d.selection[0];
alert(item.constructor.name);

And to my surprise.

 it output: “PathItem”—which just made me even more frustrated

1 reply

dublove
dubloveAuthor
Legend
June 2, 2026

I think I've got it.。

 

var d = app.activeDocument;
var pl = d.pathItems.length;
for (i = 0; i < pl; i++) {
    //d.pathItems[i].locked = false;
    d.pathItems[i].moveToEnd(mylayer);
}

But I can't figure out how to unlock the guides.

dublove
dubloveAuthor
Legend
June 3, 2026

There's a problem.
pathItems contains not only guides but also path shapes.
What is the specific technical term for guides?