Photoshop JavaScript:删除所有指南?

发布于 2025-01-23 19:52:26 字数 129 浏览 2 评论 0原文

我只能找出一种从布局中删除单个指南的方法:

activeDocument.guides[0].remove();

这是使用索引的单个指南。我没有一个菜单一次可以一次清除所有指南吗?

I can only find out a way to remove a single guide from the layout:

activeDocument.guides[0].remove();

This targets a single guide using an index. Isn't there a menu I can call to clear all guides at once?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

对风讲故事 2025-01-30 19:52:26

传统上,您必须以相反的顺序删除指南:

// function CLEAR ALL GUIDES ()
// ----------------------------------------------------------------
function clear_all_guides()
{
  var numGuides = activeDocument.guides.length;
  if (numGuides == 0) return;

  // Delete 'em in reverse order 
  for (var i = numGuides -1; i >=0; i--)
  {
    app.activeDocument.guides[i].remove();
  }
}

这与

 var idclearAllGuides = stringIDToTypeID( "clearAllGuides" );
 executeAction( idclearAllGuides, undefined, DialogModes.NO );

Traditionally, you had to remove the guides in reverse order:

// function CLEAR ALL GUIDES ()
// ----------------------------------------------------------------
function clear_all_guides()
{
  var numGuides = activeDocument.guides.length;
  if (numGuides == 0) return;

  // Delete 'em in reverse order 
  for (var i = numGuides -1; i >=0; i--)
  {
    app.activeDocument.guides[i].remove();
  }
}

which is the same as

 var idclearAllGuides = stringIDToTypeID( "clearAllGuides" );
 executeAction( idclearAllGuides, undefined, DialogModes.NO );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文